Skip to content

Commit

Permalink
chore: only write auth writer core once in CoreOwnership (#755)
Browse files Browse the repository at this point in the history
We want to call a function once the auth writer core emits its `ready`
event. Using `once` lets us clean up the listener once it fires, rather
than leaving it around.

Extracted from [#390].

[#390]: #390

Co-authored-by: Gregor MacLennan <[email protected]>
  • Loading branch information
EvanHahn and gmaclennan committed Aug 23, 2024
1 parent 794fb38 commit 4e19cbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core-ownership.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class CoreOwnership {
if (authWriterCore.opened) {
writeOwnership()
} else {
authWriterCore.on('ready', writeOwnership)
authWriterCore.once('ready', writeOwnership)
}
}

Expand Down

0 comments on commit 4e19cbc

Please sign in to comment.