File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,9 @@ import { useSettings } from '@stores/useSettings'
3
3
import ModalBox from ' @components/ModalBox.vue'
4
4
import { updateAuthKey } from ' @/api'
5
5
import useStoreMapping from ' @/utils/storeRouteMapping'
6
+ import type { RouteRecordName } from ' vue-router'
6
7
7
- const routesToExclude = [' home' , ' settings' ]
8
+ const routesToExclude: RouteRecordName [] = [' home' , ' settings' ]
8
9
const route = useRoute ()
9
10
const { storeMapping } = useStoreMapping ()
10
11
const settings = useSettings ()
@@ -30,10 +31,8 @@ const authenticate = async () => {
30
31
}
31
32
32
33
const currentComponentLoading = computed (() => {
33
- const routeName = route .name ?.toString ()
34
- let store
35
- if (routeName !== undefined && ! routesToExclude .includes (routeName )) {
36
- store = storeMapping [routeName as keyof typeof storeMapping ]
34
+ if (route .name !== undefined && ! routesToExclude .includes (route .name ?? ' ' )) {
35
+ const store = storeMapping [route .name as keyof typeof storeMapping ]
37
36
const { currentState } = storeToRefs (store )
38
37
return store && currentState .value .loading
39
38
}
You can’t perform that action at this time.
0 commit comments