Skip to content

Commit

Permalink
[#58] fix profile store errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreezag committed Apr 23, 2024
1 parent 8296720 commit f83a2ad
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { LayoutSidebar } from "~/src/widgets/ui";
import { useEvents } from "~/src/shared/lib/use-events";
import { useSettings } from "~/src/shared/lib/use-settings";
import SfdumpWrap from "~/src/shared/lib/vendor/dumper";
import { useProfileStore } from "~~/src/shared/stores/profile";
import { useProfileStore, useSettingsStore } from "~~/src/shared/stores";
import { version } from "../package.json";
useSettingsStore();
SfdumpWrap(window.document);
const { profile } = storeToRefs(useProfileStore());
Expand Down
6 changes: 2 additions & 4 deletions pages/login.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<script setup lang="ts">
import { useNuxtApp, navigateTo, setPageLayout } from "#app"; // eslint-disable-line @conarti/feature-sliced/layers-slices
import { REST_API_URL } from "~/src/shared/lib/io";
import { useProfileStore } from "~/src/shared/stores/profile";
import { useProfileStore, useSettingsStore } from "~/src/shared/stores";
import { IconSvg } from "~/src/shared/ui";
// definePageMeta({
// layout: 'blank'
// })
useSettingsStore();
setPageLayout("blank");
const app = useNuxtApp();
Expand Down
1 change: 1 addition & 0 deletions src/shared/stores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from './connections'
export * from './events'
export * from './locked-ids'
export * from './settings'
export * from './profile'
6 changes: 3 additions & 3 deletions src/shared/stores/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const STORAGE_KEY = "token";

export const useProfileStore = defineStore("profileStore", {
state: () => ({
token: null as string | null,
profile: null as Profile | null,
token: '' as string,
profile: undefined as Profile | undefined,
}),
getters: {
isAuthenticated(): boolean {
Expand All @@ -28,7 +28,7 @@ export const useProfileStore = defineStore("profileStore", {
this.setToken(localStorage?.getItem(STORAGE_KEY));
},
removeToken(): void {
this.token = null;
this.token = '';
localStorage?.removeItem(STORAGE_KEY);
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/shared/ui/pause-button/pause-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const toggleUpdate = () => {
</template>

<style lang="scss" scoped>
@import "src/assets/mixins";
.pause-button {
@include button;
@apply bg-blue-400 dark:bg-gray-700 hover:bg-blue-500 dark:hover:bg-blue-800;
Expand Down

0 comments on commit f83a2ad

Please sign in to comment.