@@ -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-drilldown-table' ;
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/' ,
@@ -56,29 +56,29 @@ export const useCoreStore = defineStore('core', () => {
56
56
57
57
const actions = {
58
58
setLocalStorage ( val : string ) : string {
59
- const oldValue = localStorage . getItem ( storageName ) ;
59
+ const oldValue = localStorage . getItem ( packageName ) ;
60
60
const newValue = val ?? oldValue ;
61
61
62
- localStorage . setItem ( storageName , newValue ) ;
62
+ localStorage . setItem ( packageName , newValue ) ;
63
63
return newValue ;
64
64
} ,
65
65
setTheme ( val : string ) : string {
66
66
const themeName = val === 'dark' ? 'light' : 'dark' ;
67
- const currentTheme = localStorage . getItem ( `${ storageName } -theme` ) ;
67
+ const currentTheme = localStorage . getItem ( `${ packageName } -theme` ) ;
68
68
const newTheme = themeName ?? currentTheme ;
69
69
70
- localStorage . setItem ( `${ storageName } -theme` , newTheme ) ;
70
+ localStorage . setItem ( `${ packageName } -theme` , newTheme ) ;
71
71
return newTheme ;
72
72
} ,
73
73
} ;
74
74
75
75
const getters = {
76
76
getLocalStorage : ( ) => ( ) : unknown => {
77
- const value = localStorage . getItem ( storageName ) ;
77
+ const value = localStorage . getItem ( packageName ) ;
78
78
return value ;
79
79
} ,
80
80
getTheme : ( ) => {
81
- const value = localStorage . getItem ( `${ storageName } -theme` ) ;
81
+ const value = localStorage . getItem ( `${ packageName } -theme` ) ;
82
82
return value ;
83
83
} ,
84
84
} ;
@@ -89,8 +89,8 @@ export const useCoreStore = defineStore('core', () => {
89
89
...getters ,
90
90
links,
91
91
package : packageJson ,
92
+ packageName,
92
93
pluginVersion : packageJson . version ,
93
- storageName,
94
94
tableHeaders,
95
95
} ;
96
96
} ) ;
0 commit comments