-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix markNoficationRead for default account
- Loading branch information
1 parent
829b6d0
commit a3e94ae
Showing
3 changed files
with
34 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { AccountInfo } from '../../shared-types'; | ||
import type { AppReduxState } from '../types'; | ||
import { defaultAccountInfo } from './constants'; | ||
|
||
export function getAllAccounts(state: AppReduxState): AccountInfo[] { | ||
// FIXME: This should be a permanent migration to the account system somewhere | ||
const doesIncludeMainGithubAccount = state.accounts.some( | ||
(account) => account.serverUrl === defaultAccountInfo.serverUrl | ||
); | ||
if (!doesIncludeMainGithubAccount && state.token) { | ||
return [ | ||
...state.accounts, | ||
{ | ||
...defaultAccountInfo, | ||
apiKey: state.token, | ||
}, | ||
]; | ||
} | ||
return state.accounts; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters