Skip to content

Commit 6da8462

Browse files
committed
fix: storage keys
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 57b6982 commit 6da8462

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

src/renderer/constants.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ export const OAUTH_SCOPE: Record<OAuthScope, OAuthScopeDetails> = {
3232
};
3333

3434
export const Constants = {
35-
STORAGE_KEY: 'gitify-storage',
36-
37-
// Filters store key
38-
FILTERS_STORE_KEY: 'atlassify-filters',
35+
// Local storage keys
36+
STORAGE: {
37+
// Legacy storage key (soon to be deprecated)
38+
LEGACY: 'gitify-storage',
39+
// ACCOUNTS: 'gitify-accounts',
40+
FILTERS: 'gitify-filters',
41+
// SETTINGS: 'gitify-settings',
42+
},
3943

4044
// GitHub OAuth Scopes — each tier is an ordered array of OAUTH_SCOPE objects.
4145
// REQUIRED: minimum scopes Gitify needs to function.

src/renderer/stores/useFiltersStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const useFiltersStore = create<FiltersStore>()(
4848
},
4949
}),
5050
{
51-
name: Constants.FILTERS_STORE_KEY,
51+
name: Constants.STORAGE.FILTERS,
5252
},
5353
),
5454
);

src/renderer/utils/core/storage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Constants } from '../../constants';
33
import type { GitifyState } from '../../types';
44

55
export function loadState(): GitifyState {
6-
const existing = localStorage.getItem(Constants.STORAGE_KEY);
6+
const existing = localStorage.getItem(Constants.STORAGE.LEGACY);
77
const { auth, settings } = (existing && JSON.parse(existing)) || {};
88
return { auth, settings };
99
}
@@ -12,7 +12,7 @@ export function saveState(gitifyState: GitifyState) {
1212
const auth = gitifyState.auth;
1313
const settings = gitifyState.settings;
1414
const settingsString = JSON.stringify({ auth, settings });
15-
localStorage.setItem(Constants.STORAGE_KEY, settingsString);
15+
localStorage.setItem(Constants.STORAGE.LEGACY, settingsString);
1616
}
1717

1818
export function clearState() {

0 commit comments

Comments
 (0)