Replace updateCurrentAccount() with refreshSession() (#3910)
Replace updateCurrentAccount() with resumeSession()
This commit is contained in:
parent
f62b0458a7
commit
0c6bf276dd
9 changed files with 15 additions and 257 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue