Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(user): fix users offline status delay #4973

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions libraries/Iridium/IridiumManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ export class IridiumManager extends Emitter {
* @param param0 Textile Configuration that includes id, password and SolanaWallet instance
* @returns a promise that resolves when the initialization completes
*/
async start({ pass, wallet }: { pass: string; wallet: Account }) {
async start() {
this.connector?.on('stopping', async () => {
logger.info('iridium/manager', 'stopping')
await this.stop()
})

logger.info('iridium/manager', 'init()')
const seed = await IdentityManager.seedFromWallet(pass, wallet)
return this.initFromEntropy(seed)
}

async stop() {
await this.friends.stop?.()
await this.users.stop?.()
await this.profile.stop?.()
await this.groups.stop?.()
await this.chat.stop?.()
await this.files.stop?.()
await this.webRTC.stop?.()
await this.settings.stop?.()
await this.notifications.stop?.()
await Promise.all([
this.friends.stop?.(),
this.users.stop?.(),
this.profile.stop?.(),
this.groups.stop?.(),
this.chat.stop?.(),
this.files.stop?.(),
this.webRTC.stop?.(),
this.settings.stop?.(),
this.notifications.stop?.(),
])
}

get id(): string {
Expand Down
2 changes: 2 additions & 0 deletions store/accounts/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export default {
'dispatching iridium/initializeFromEntropy',
)
await iridium.initFromEntropy(entropy)
await iridium.start()
}

const profile = await iridium.profile?.get()
Expand Down Expand Up @@ -285,6 +286,7 @@ export default {
'dispatching iridium/initializeFromEntropy',
)
await iridium.initFromEntropy(entropy)
await iridium.start()
}

if (!iridium.connector) {
Expand Down