Skip to content

Commit e8cb61d

Browse files
fix: adjust variable names
1 parent f5e3f3e commit e8cb61d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Diff for: src/stores/index.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ import packageJson from '@root/package.json';
33

44

55
export const useCoreStore = defineStore('core', () => {
6-
const packageName = packageJson.name;
7-
const storageName = packageName.split('/')[1];
6+
const scopedPackageName = packageJson.name;
7+
const packageName = scopedPackageName.split('/')[1];
88

99
// Links //
10-
const repoBaseUrl = `https://github.com/webdevnerdstuff/${storageName}`;
10+
const repoBaseUrl = `https://github.com/webdevnerdstuff/${packageName}`;
1111
const links = {
1212
changeLog: `${repoBaseUrl}/blob/main/CHANGELOG.md`,
1313
discord: 'https://discord.com/users/979453275369783346',
1414
github: repoBaseUrl,
1515
githubProfile: 'https://github.com/webdevnerdstuff',
1616
license: `${repoBaseUrl}/blob/main/LICENSE.md`,
17-
npm: `https://www.npmjs.com/package/${packageName}`,
17+
npm: `https://www.npmjs.com/package/${scopedPackageName}`,
1818
vue: 'https://vuejs.org/',
1919
vueUse: 'https://vueuse.org/',
2020
vuetify: 'https://vuetifyjs.com/',
@@ -23,29 +23,29 @@ export const useCoreStore = defineStore('core', () => {
2323

2424
const actions = {
2525
setLocalStorage(val: string): string {
26-
const oldValue = localStorage.getItem(storageName);
26+
const oldValue = localStorage.getItem(packageName);
2727
const newValue = val ?? oldValue;
2828

29-
localStorage.setItem(storageName, newValue);
29+
localStorage.setItem(packageName, newValue);
3030
return newValue;
3131
},
3232
setTheme(val: string): string {
3333
const themeName = val === 'dark' ? 'light' : 'dark';
34-
const currentTheme = localStorage.getItem(`${storageName}-theme`);
34+
const currentTheme = localStorage.getItem(`${packageName}-theme`);
3535
const newTheme = themeName ?? currentTheme;
3636

37-
localStorage.setItem(`${storageName}-theme`, newTheme);
37+
localStorage.setItem(`${packageName}-theme`, newTheme);
3838
return newTheme;
3939
},
4040
};
4141

4242
const getters = {
4343
getLocalStorage: () => (): unknown => {
44-
const value = localStorage.getItem(storageName);
44+
const value = localStorage.getItem(packageName);
4545
return value;
4646
},
4747
getTheme: () => {
48-
const value = localStorage.getItem(`${storageName}-theme`);
48+
const value = localStorage.getItem(`${packageName}-theme`);
4949
return value;
5050
},
5151
};
@@ -56,6 +56,6 @@ export const useCoreStore = defineStore('core', () => {
5656
links,
5757
package: packageJson,
5858
pluginVersion: packageJson.version,
59-
storageName,
59+
packageName,
6060
};
6161
});

0 commit comments

Comments
 (0)