Skip to content

Commit

Permalink
chore: only write auth writer core once in CoreOwnership
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 16, 2024
1 parent a2c0467 commit 977ef77
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 977ef77

Please sign in to comment.