Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/renderer/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ export const OAUTH_SCOPE: Record<OAuthScope, OAuthScopeDetails> = {
};

export const Constants = {
STORAGE_KEY: 'gitify-storage',

// Filters store key
FILTERS_STORE_KEY: 'atlassify-filters',
// Local storage keys
STORAGE: {
// Legacy storage key (soon to be deprecated)
LEGACY: 'gitify-storage',
// ACCOUNTS: 'gitify-accounts',
FILTERS: 'gitify-filters',
// SETTINGS: 'gitify-settings',
},

// GitHub OAuth Scopes — each tier is an ordered array of OAUTH_SCOPE objects.
// REQUIRED: minimum scopes Gitify needs to function.
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/stores/useFiltersStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const useFiltersStore = create<FiltersStore>()(
},
}),
{
name: Constants.FILTERS_STORE_KEY,
name: Constants.STORAGE.FILTERS,
},
),
);
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/utils/core/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Constants } from '../../constants';
import type { GitifyState } from '../../types';

export function loadState(): GitifyState {
const existing = localStorage.getItem(Constants.STORAGE_KEY);
const existing = localStorage.getItem(Constants.STORAGE.LEGACY);
const { auth, settings } = (existing && JSON.parse(existing)) || {};
return { auth, settings };
}
Expand All @@ -12,7 +12,7 @@ export function saveState(gitifyState: GitifyState) {
const auth = gitifyState.auth;
const settings = gitifyState.settings;
const settingsString = JSON.stringify({ auth, settings });
localStorage.setItem(Constants.STORAGE_KEY, settingsString);
localStorage.setItem(Constants.STORAGE.LEGACY, settingsString);
}

export function clearState() {
Expand Down
Loading