From 5c85d27a2f94f85292bcac9f382fe36e6e7eccab Mon Sep 17 00:00:00 2001 From: zlayine Date: Fri, 29 Sep 2023 17:23:53 +0300 Subject: [PATCH] fix settings --- resources/js/components/pages/Settings.vue | 203 +++++++++++---------- resources/js/store/index.ts | 1 + 2 files changed, 111 insertions(+), 93 deletions(-) diff --git a/resources/js/components/pages/Settings.vue b/resources/js/components/pages/Settings.vue index 6836632..ff38913 100644 --- a/resources/js/components/pages/Settings.vue +++ b/resources/js/components/pages/Settings.vue @@ -1,105 +1,111 @@ @@ -118,6 +124,7 @@ import CopyTextIcon from '../CopyTextIcon.vue'; import { PencilIcon } from '@heroicons/vue/20/solid'; import { AuthApi } from '~/api/auth'; import { addressToPublicKey, isValidAddress, publicKeyToAddress } from '~/util/address'; +import LoadingCircle from '../LoadingCircle.vue'; const router = useRouter(); const appStore = useAppStore(); @@ -127,6 +134,7 @@ const tokenName = ref(); const walletAccount = ref(publicKeyToAddress(appStore.user?.account)); const enableTokenCreate = ref(false); const enableAccountModify = ref(false); +const loading = ref(true); const tokens = computed(() => appStore.user?.apiTokens); @@ -226,4 +234,13 @@ watch( } } ); + +watch( + () => appStore.user, + (userVal) => { + if (userVal) { + loading.value = false; + } + } +); diff --git a/resources/js/store/index.ts b/resources/js/store/index.ts index 38ffe3d..501f93e 100644 --- a/resources/js/store/index.ts +++ b/resources/js/store/index.ts @@ -177,6 +177,7 @@ export const useAppStore = defineStore('app', { return res.data.Login; }, async logout() { + this.loggedIn = false; await AuthApi.logout(); this.clearLogin(); },