Skip to content

Commit 4e19cbc

Browse files
EvanHahngmaclennan
andauthored
chore: only write auth writer core once in CoreOwnership (#755)
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]>
1 parent 794fb38 commit 4e19cbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core-ownership.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class CoreOwnership {
4949
if (authWriterCore.opened) {
5050
writeOwnership()
5151
} else {
52-
authWriterCore.on('ready', writeOwnership)
52+
authWriterCore.once('ready', writeOwnership)
5353
}
5454
}
5555

0 commit comments

Comments
 (0)