Skip to content

Commit

Permalink
Revert some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
islathehut committed Jan 27, 2025
1 parent c570a99 commit 9a98b64
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/backend/src/nest/auth/sigchain.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ export class SigChainService implements OnModuleInit {
* @returns Whether the chain was set as active
*/
addChain(chain: SigChain, setActive: boolean, teamName?: string): boolean {
const name = teamName || chain.team!.teamName
if (this.chains.has(name)) {
if (this.chains.has(chain.team.teamName)) {
throw new Error(`Chain for team ${teamName} already exists`)
}
this.chains.set(name, chain)
this.chains.set(chain.team.teamName, chain)
if (setActive) {
this.setActiveChain(name)
this.setActiveChain(chain.team.teamName)
return true
}
return false
Expand Down Expand Up @@ -120,7 +119,7 @@ export class SigChainService implements OnModuleInit {
): Promise<SigChain> {
this.logger.info('Deserializing chain')
const sigChain = SigChain.load(serializedTeam, context, teamKeyRing)
this.addChain(sigChain, setActive, sigChain.team?.teamName)
this.addChain(sigChain, setActive)
return sigChain
}

Expand Down

0 comments on commit 9a98b64

Please sign in to comment.