[Session] Base (#3541)

* Add readLastActiveAccount to use accounts[] as source of truth

* Add public service constant, use
This commit is contained in:
Eric Bailey 2024-04-25 10:35:21 -05:00 committed by GitHub
parent 5b82b15007
commit 6aded4f257
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 5 deletions

View file

@ -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 = {

View 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)
}