Skip to content

fix(settings): crash when closing the Directory Page settings dialog - #681

Open
nikitatsym wants to merge 1 commit into
SergeyMosin:masterfrom
nikitatsym:fix-dir-settings-close
Open

fix(settings): crash when closing the Directory Page settings dialog#681
nikitatsym wants to merge 1 commit into
SergeyMosin:masterfrom
nikitatsym:fix-dir-settings-close

Conversation

@nikitatsym

Copy link
Copy Markdown

NC 34.0.3, Appointments 2.7.4:

  1. Open Directory Page → Settings
  2. Close the dialog

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 before emit('close-settings'), so settingsPageId in 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 the label computed above.

Verified against NC 34.0.3 with a rebuilt bundle: clean close, dialogs reopen, no console errors.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant