Skip to content

Commit

Permalink
isDefault should return true for atomic sessions as well (#636)
Browse files Browse the repository at this point in the history
* isDefault should return true for atomic sessions as well

* Update session-state.js

---------

Co-authored-by: Mathias Buus <mathiasbuus@gmail.com>
  • Loading branch information
chm-diederichs and mafintosh authored Feb 11, 2025
1 parent cc340d4 commit 157b0fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/session-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ module.exports = class SessionState {
}

isDefault () {
return this.core.state === this
return this.core.state === this || this.isAtomicDefault()
}

isAtomicDefault () {
return !!this.storage.atom && !!this.parent && this.parent.isDefault()
}

createTreeBatch () {
Expand Down

0 comments on commit 157b0fe

Please sign in to comment.