@@ -3,8 +3,8 @@ import packageJson from '@root/package.json';
3
3
4
4
5
5
export const useCoreStore = defineStore ( 'core' , ( ) => {
6
- const packageName = packageJson . name ;
7
- const storageName = 'vuetify-inline-fields' ;
6
+ const scopedPackageName = packageJson . name ;
7
+ const packageName = scopedPackageName . split ( '/' ) [ 1 ] ;
8
8
9
9
// Links //
10
10
const repoBaseUrl = `https://github.com/webdevnerdstuff/${ packageName } ` ;
@@ -14,7 +14,7 @@ export const useCoreStore = defineStore('core', () => {
14
14
github : repoBaseUrl ,
15
15
githubProfile : 'https://github.com/webdevnerdstuff' ,
16
16
license : `${ repoBaseUrl } /blob/main/LICENSE.md` ,
17
- npm : `https://www.npmjs.com/package/${ packageName } ` ,
17
+ npm : `https://www.npmjs.com/package/${ scopedPackageName } ` ,
18
18
vue : 'https://vuejs.org/' ,
19
19
vueUse : 'https://vueuse.org/' ,
20
20
vuetify : 'https://vuetifyjs.com/' ,
@@ -23,29 +23,29 @@ export const useCoreStore = defineStore('core', () => {
23
23
24
24
const actions = {
25
25
setLocalStorage ( val : string ) : string {
26
- const oldValue = localStorage . getItem ( storageName ) ;
26
+ const oldValue = localStorage . getItem ( packageName ) ;
27
27
const newValue = val ?? oldValue ;
28
28
29
- localStorage . setItem ( storageName , newValue ) ;
29
+ localStorage . setItem ( packageName , newValue ) ;
30
30
return newValue ;
31
31
} ,
32
32
setTheme ( val : string ) : string {
33
33
const themeName = val === 'dark' ? 'light' : 'dark' ;
34
- const currentTheme = localStorage . getItem ( `${ storageName } -theme` ) ;
34
+ const currentTheme = localStorage . getItem ( `${ packageName } -theme` ) ;
35
35
const newTheme = themeName ?? currentTheme ;
36
36
37
- localStorage . setItem ( `${ storageName } -theme` , newTheme ) ;
37
+ localStorage . setItem ( `${ packageName } -theme` , newTheme ) ;
38
38
return newTheme ;
39
39
} ,
40
40
} ;
41
41
42
42
const getters = {
43
43
getLocalStorage : ( ) => ( ) : unknown => {
44
- const value = localStorage . getItem ( storageName ) ;
44
+ const value = localStorage . getItem ( packageName ) ;
45
45
return value ;
46
46
} ,
47
47
getTheme : ( ) => {
48
- const value = localStorage . getItem ( `${ storageName } -theme` ) ;
48
+ const value = localStorage . getItem ( `${ packageName } -theme` ) ;
49
49
return value ;
50
50
} ,
51
51
} ;
@@ -56,6 +56,6 @@ export const useCoreStore = defineStore('core', () => {
56
56
links,
57
57
package : packageJson ,
58
58
pluginVersion : packageJson . version ,
59
- storageName ,
59
+ packageName ,
60
60
} ;
61
61
} ) ;
0 commit comments