Skip to content

Commit

Permalink
Closes #2465 (#2500)
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat authored Jan 8, 2025
1 parent 8d7d9a1 commit 191962e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions shared/domains/chelonia/chelonia.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,9 @@ export default (sbp('sbp/selectors/register', {
postCleanupFn = newState
newState = undefined
}
sbp('chelonia/private/stopClockSync')
if (this.pubsub) {
sbp('chelonia/private/stopClockSync')
}
// wait for any pending sync operations to finish before saving
Object.keys(this.postSyncOperations).forEach(cID => {
sbp('chelonia/private/enqueuePostSyncOps', cID)
Expand Down Expand Up @@ -373,7 +375,9 @@ export default (sbp('sbp/selectors/register', {
sbp('chelonia/clearTransientSecretKeys')
sbp('okTurtles.events/emit', CHELONIA_RESET)
sbp('okTurtles.events/emit', CONTRACTS_MODIFIED, Array.from(this.subscriptionSet), { added: [], removed: removedContractIDs })
sbp('chelonia/private/startClockSync')
if (this.pubsub) {
sbp('chelonia/private/startClockSync')
}
if (newState) {
Object.entries(newState).forEach(([key, value]) => {
this.config.reactiveSet(rootState, key, value)
Expand Down Expand Up @@ -557,6 +561,9 @@ export default (sbp('sbp/selectors/register', {
// its console output until we have a better solution. Do not use for auth.
pubsubURL += `?debugID=${randomHexString(6)}`
}
if (this.pubsub) {
sbp('chelonia/private/stopClockSync')
}
sbp('chelonia/private/startClockSync')
this.pubsub = createClient(pubsubURL, {
...this.config.connectionOptions,
Expand Down

0 comments on commit 191962e

Please sign in to comment.