Skip to content

Commit

Permalink
refactor: create a KBD_SHORTCUT_DEFAULT constant
Browse files Browse the repository at this point in the history
  • Loading branch information
adufr committed Apr 17, 2024
1 parent 8bad772 commit 81ad51f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/__mocks__/mock-state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type AuthState, type SettingsState, Theme } from '../types';
import Constants from '../utils/constants';
import { mockedEnterpriseAccounts, mockedUser } from './mockedData';

export const mockAccounts: AuthState = {
Expand All @@ -18,6 +19,6 @@ export const mockSettings: SettingsState = {
detailedNotifications: false,
markAsDoneOnOpen: false,
showAccountHostname: false,
kbdShortcut: 'CmdOrCtrl+Alt+G',
kbdShortcut: Constants.KBD_SHORTCUT_DEFAULT,
kbdShortcutEnabled: false,
};
5 changes: 3 additions & 2 deletions src/context/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useNotifications } from '../hooks/useNotifications';
import type { AuthState, SettingsState } from '../types';
import * as apiRequests from '../utils/api-requests';
import * as comms from '../utils/comms';
import Constants from '../utils/constants';
import * as notifications from '../utils/notifications';
import * as storage from '../utils/storage';
import { AppContext, AppProvider } from './App';
Expand Down Expand Up @@ -291,7 +292,7 @@ describe('context/App.tsx', () => {
detailedNotifications: false,
markAsDoneOnOpen: false,
showAccountHostname: false,
kbdShortcut: 'CmdOrCtrl+Alt+G',
kbdShortcut: Constants.KBD_SHORTCUT_DEFAULT,
kbdShortcutEnabled: false,
},
);
Expand Down Expand Up @@ -337,7 +338,7 @@ describe('context/App.tsx', () => {
detailedNotifications: false,
markAsDoneOnOpen: false,
showAccountHostname: false,
kbdShortcut: 'CmdOrCtrl+Alt+G',
kbdShortcut: Constants.KBD_SHORTCUT_DEFAULT,
kbdShortcutEnabled: false,
},
);
Expand Down
2 changes: 1 addition & 1 deletion src/context/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const defaultSettings: SettingsState = {
detailedNotifications: false,
markAsDoneOnOpen: false,
showAccountHostname: false,
kbdShortcut: 'CmdOrCtrl+Alt+G',
kbdShortcut: Constants.KBD_SHORTCUT_DEFAULT,
kbdShortcutEnabled: false,
};

Expand Down
2 changes: 2 additions & 0 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const Constants = {
ALLREAD_EMOJIS: ['😉', '🎉', '🐯', '🙈', '🎈', '🎊', '👏', '🎪', '🍝'],

FETCH_INTERVAL: 60000,

KBD_SHORTCUT_DEFAULT: 'CmdOrCtrl+Alt+G',
};

export const Errors: Record<ErrorType, GitifyError> = {
Expand Down

0 comments on commit 81ad51f

Please sign in to comment.