Skip to content

Commit b06cb67

Browse files
committed
refresh status on correct api key
1 parent 0d8836f commit b06cb67

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const routesToExclude = ['home', 'settings']
88
const route = useRoute()
99
const { storeMapping } = useStoreMapping()
1010
const settings = useSettings()
11-
const { getStatus } = settings
11+
const { getStatus, refreshStatus } = settings
1212
const { isReadyAndAuth } = storeToRefs(settings)
1313
1414
const authBox = ref<InstanceType<typeof ModalBox>>()
@@ -23,6 +23,7 @@ const authenticate = async () => {
2323
if (!hasError.value) {
2424
authBox.value?.toggleModal()
2525
isReadyAndAuth.value = true
26+
refreshStatus()
2627
// TODO: Fix the composable
2728
//resetAllStores()
2829
}

src/stores/useSettings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const useSettings = defineStore('settings', () => {
3838
return result.data ?? result.message
3939
}
4040

41-
const { state: cat } = useAsyncState(getStatus, {} as Status)
41+
const { state: cat, execute } = useAsyncState(getStatus, {} as Status)
4242

4343
watchEffect(() => {
4444
isReadyAndAuth.value = cat.value != 'Invalid API Key'
@@ -50,6 +50,7 @@ export const useSettings = defineStore('settings', () => {
5050
toggleDark,
5151
cat,
5252
getStatus,
53+
refreshStatus: execute,
5354
isReadyAndAuth,
5455
}
5556
})

0 commit comments

Comments
 (0)