Replace updateCurrentAccount() with refreshSession() (#3910)

Replace updateCurrentAccount() with resumeSession()
This commit is contained in:
dan 2024-05-08 23:11:39 +01:00 committed by GitHub
parent f62b0458a7
commit 0c6bf276dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 15 additions and 257 deletions

View file

@ -36,15 +36,6 @@ export type Action =
newAgent: OpaqueBskyAgent
newAccount: SessionAccount
}
| {
type: 'updated-current-account'
updatedFields: Partial<
Pick<
SessionAccount,
'handle' | 'email' | 'emailConfirmed' | 'emailAuthFactor'
>
>
}
| {
type: 'removed-account'
accountDid: string
@ -134,23 +125,6 @@ export function reducer(state: State, action: Action): State {
needsPersist: true,
}
}
case 'updated-current-account': {
const {updatedFields} = action
return {
accounts: state.accounts.map(a => {
if (a.did === state.currentAgentState.did) {
return {
...a,
...updatedFields,
}
} else {
return a
}
}),
currentAgentState: state.currentAgentState,
needsPersist: true,
}
}
case 'removed-account': {
const {accountDid} = action
return {