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(init): fix error about sync init without did #4910

Merged
merged 1 commit into from
Sep 16, 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
9 changes: 6 additions & 3 deletions libraries/Iridium/IridiumManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ export class IridiumManager extends Emitter {
async sendSyncInit(
did: string | undefined = this.connector?.p2p.primaryNodeID,
) {
if (!did) {
logger.error('iridium/manager', 'cannot send sync init to invalid did')
if (!did && !this.connector?.p2p.primaryNodeID) {
logger.error('iridium/manager', 'cannot send sync init without a did')
return
}
const profile = this.profile.state
Expand All @@ -239,7 +239,10 @@ export class IridiumManager extends Emitter {
status: profile?.status,
}

return this.connector?.send(did, payload)
return this.connector?.send(
(did || this.connector.p2p.primaryNodeID) as string,
payload,
)
}
}

Expand Down
1 change: 0 additions & 1 deletion store/accounts/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ export default {
commit('setRegistrationStatus', RegistrationStatus.REGISTERED)
commit('setActiveAccount', iridium.id)
commit('setUserDetails', profile)
await iridium.sendSyncInit()
return dispatch('startup', walletAccount)
},

Expand Down