diff --git a/libraries/Iridium/IridiumManager.ts b/libraries/Iridium/IridiumManager.ts index d495e30979..67714e27bd 100644 --- a/libraries/Iridium/IridiumManager.ts +++ b/libraries/Iridium/IridiumManager.ts @@ -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 { diff --git a/store/accounts/actions.ts b/store/accounts/actions.ts index 6772869a54..8588d2a88d 100644 --- a/store/accounts/actions.ts +++ b/store/accounts/actions.ts @@ -194,6 +194,7 @@ export default { 'dispatching iridium/initializeFromEntropy', ) await iridium.initFromEntropy(entropy) + await iridium.start() } const profile = await iridium.profile?.get() @@ -285,6 +286,7 @@ export default { 'dispatching iridium/initializeFromEntropy', ) await iridium.initFromEntropy(entropy) + await iridium.start() } if (!iridium.connector) {