Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Leblow committed Apr 4, 2024
1 parent c662411 commit f065343
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI

const localAddress = createLibp2pAddress(payload.hiddenService.onionAddress, payload.peerId.id)

const community = {
let community: Community = {
id: payload.id,
name: payload.name,
CA: payload.CA,
Expand All @@ -372,14 +372,19 @@ export class ConnectionsManagerService extends EventEmitter implements OnModuleI

await this.launchCommunity({ community, network })

const meta = await this.storageService.updateCommunityMetadata(payload)
const community = await this.localDbService.getCurrentCommunity()
const meta = await this.storageService.updateCommunityMetadata({
id: community.id,
rootCa: community.rootCa as string,
ownerCertificate: community.ownerCertificate as string,
})
const currentCommunity = await this.localDbService.getCurrentCommunity()

if (meta && community) {
await this.localDbService.setCommunity({
...community,
if (meta && currentCommunity) {
community = {
...currentCommunity,
ownerOrbitDbIdentity: meta.ownerOrbitDbIdentity,
})
}
await this.localDbService.setCommunity(community)
}

this.logger(`Created and launched community ${community.id}`)
Expand Down

0 comments on commit f065343

Please sign in to comment.