Skip to content

Commit 977ef77

Browse files
EvanHahngmaclennan
andcommitted
chore: only write auth writer core once in CoreOwnership
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 <gmaclennan@digital-democracy.org>
1 parent a2c0467 commit 977ef77

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)