[Session] Base (#3541)
* Add readLastActiveAccount to use accounts[] as source of truth * Add public service constant, use
This commit is contained in:
parent
5b82b15007
commit
6aded4f257
5 changed files with 14 additions and 5 deletions
|
@ -1,7 +1,9 @@
|
|||
import {BskyAgent} from '@atproto/api'
|
||||
|
||||
import {PUBLIC_BSKY_SERVICE} from '#/lib/constants'
|
||||
|
||||
export const PUBLIC_BSKY_AGENT = new BskyAgent({
|
||||
service: 'https://public.api.bsky.app',
|
||||
service: PUBLIC_BSKY_SERVICE,
|
||||
})
|
||||
|
||||
export const STALE = {
|
||||
|
|
6
src/state/session/util/readLastActiveAccount.ts
Normal file
6
src/state/session/util/readLastActiveAccount.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
import * as persisted from '#/state/persisted'
|
||||
|
||||
export function readLastActiveAccount() {
|
||||
const {currentAccount, accounts} = persisted.get('session')
|
||||
return accounts.find(a => a.did === currentAccount?.did)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue