fix(settings): crash when closing the Directory Page settings dialog - #681
Open
nikitatsym wants to merge 1 commit into
Open
fix(settings): crash when closing the Directory Page settings dialog#681nikitatsym wants to merge 1 commit into
nikitatsym wants to merge 1 commit into
Conversation
Closing the Directory Page settings dialog crashed with
'Cannot set properties of null (setting tsMode)': the close handler
called pagesStore.getPageById('d0'), but the pages store only holds
type === 'page' entries, so the lookup toasted 'error: page not found'
and threw. The throw also skipped emit('close-settings'), leaving
settingsPageId set in App2, so no settings dialog could be opened
again until a full reload.
Guard the tsMode sync with the existing _isDir flag, mirroring the
label computed above; directory pages have no time slot mode to sync.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NC 34.0.3, Appointments 2.7.4:
Result: toast "error: page not found", console error
Cannot set properties of null (setting 'tsMode'), and no settings dialog opens again until page reload — the throw lands beforeemit('close-settings'), sosettingsPageIdin App2 is never cleared.The pages store only holds
type === 'page'entries, so the lookup misses for'd0'— and a directory page has no tsMode to sync back anyway. Guarded the sync with the existing_isDir, like thelabelcomputed above.Verified against NC 34.0.3 with a rebuilt bundle: clean close, dialogs reopen, no console errors.