about summary refs log tree commit diff
path: root/src/state
diff options
context:
space:
mode:
Diffstat (limited to 'src/state')
-rw-r--r--src/state/events.ts15
-rw-r--r--src/state/session/index.tsx10
2 files changed, 3 insertions, 22 deletions
diff --git a/src/state/events.ts b/src/state/events.ts
index f85860823..1384abded 100644
--- a/src/state/events.ts
+++ b/src/state/events.ts
@@ -1,6 +1,4 @@
 import EventEmitter from 'eventemitter3'
-import {BskyAgent} from '@atproto/api'
-import {SessionAccount} from './session'
 
 type UnlistenFn = () => void
 
@@ -16,19 +14,6 @@ export function listenSoftReset(fn: () => void): UnlistenFn {
   return () => emitter.off('soft-reset', fn)
 }
 
-export function emitSessionLoaded(
-  sessionAccount: SessionAccount,
-  agent: BskyAgent,
-) {
-  emitter.emit('session-loaded', sessionAccount, agent)
-}
-export function listenSessionLoaded(
-  fn: (sessionAccount: SessionAccount, agent: BskyAgent) => void,
-): UnlistenFn {
-  emitter.on('session-loaded', fn)
-  return () => emitter.off('session-loaded', fn)
-}
-
 export function emitSessionDropped() {
   emitter.emit('session-dropped')
 }
diff --git a/src/state/session/index.tsx b/src/state/session/index.tsx
index 49c1326d9..76b77a087 100644
--- a/src/state/session/index.tsx
+++ b/src/state/session/index.tsx
@@ -8,7 +8,7 @@ import {logger} from '#/logger'
 import * as persisted from '#/state/persisted'
 import {PUBLIC_BSKY_AGENT} from '#/state/queries'
 import {IS_PROD} from '#/lib/constants'
-import {emitSessionLoaded, emitSessionDropped} from '../events'
+import {emitSessionDropped} from '../events'
 import {useLoggedOutViewControls} from '#/state/shell/logged-out'
 import {useCloseAllActiveElements} from '#/state/util'
 import {track} from '#/lib/analytics/analytics'
@@ -210,7 +210,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
       __globalAgent = agent
       queryClient.clear()
       upsertAccount(account)
-      emitSessionLoaded(account, agent)
 
       logger.debug(
         `session: created account`,
@@ -262,7 +261,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
       __globalAgent = agent
       queryClient.clear()
       upsertAccount(account)
-      emitSessionLoaded(account, agent)
 
       logger.debug(
         `session: logged in`,
@@ -355,12 +353,11 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
         __globalAgent = agent
         queryClient.clear()
         upsertAccount(account)
-        emitSessionLoaded(account, agent)
+
         // Intentionally not awaited to unblock the UI:
-        resumeSessionWithFreshAccount().then(async freshAccount => {
+        resumeSessionWithFreshAccount().then(freshAccount => {
           if (JSON.stringify(account) !== JSON.stringify(freshAccount)) {
             upsertAccount(freshAccount)
-            emitSessionLoaded(freshAccount, agent)
           }
         })
       } else {
@@ -368,7 +365,6 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
         __globalAgent = agent
         queryClient.clear()
         upsertAccount(freshAccount)
-        emitSessionLoaded(freshAccount, agent)
       }
 
       async function resumeSessionWithFreshAccount(): Promise<SessionAccount> {