File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,10 +32,14 @@ export const OAUTH_SCOPE: Record<OAuthScope, OAuthScopeDetails> = {
3232} ;
3333
3434export 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.
Original file line number Diff line number Diff 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) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { Constants } from '../../constants';
33import type { GitifyState } from '../../types' ;
44
55export 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
1818export function clearState ( ) {
You can’t perform that action at this time.
0 commit comments