fix(hotkeys): block the editor and quick search while a blocking operation runs
Global hotkeys come from Win32, outside the window, so the busy overlay intercepts nothing: Ctrl+Shift+A opened the editor behind it, unreachable. Guarded in openSlideOver and openQuickSearchModal rather than at each trigger - every caller routes through them, and no save path raises the overlay.
This commit is contained in:
@@ -3839,6 +3839,15 @@ const ENTRY_TEMPLATES = {
|
||||
// pre-fill the corresponding fields for the new-entry path.
|
||||
async function openSlideOver(id, opts) {
|
||||
opts = opts || {};
|
||||
// A blocking operation owns the screen (export, sync, rotation). The busy
|
||||
// overlay covers the panel, so the editor would open unreachable behind it
|
||||
// — and the Ctrl+Shift+A hotkey reaches this from outside the window, where
|
||||
// the overlay stops nothing. No save path shows the overlay, so nothing
|
||||
// legitimate opens the editor while it is up.
|
||||
if (isBusy()) {
|
||||
toast('Busy — try again in a moment', 'warning');
|
||||
return false;
|
||||
}
|
||||
const isNew = (id == null);
|
||||
const e = isNew ? null : state.entries.find(x => x.id === id);
|
||||
// Switching to another entry while the current edit has unsaved
|
||||
|
||||
@@ -465,6 +465,13 @@ function endTour() {
|
||||
}
|
||||
|
||||
function openQuickSearchModal(hideAfter, forFill) {
|
||||
// Same reason as the editor: the hotkey fires from outside the window, so
|
||||
// the busy overlay covering the app stops nothing — the modal would open
|
||||
// behind it, unreachable.
|
||||
if (typeof isBusy === 'function' && isBusy()) {
|
||||
toast('Busy — try again in a moment', 'warning');
|
||||
return;
|
||||
}
|
||||
const modal = document.getElementById('quickSearchModal');
|
||||
const input = document.getElementById('quickSearchInput');
|
||||
modal.classList.remove('is-hidden');
|
||||
|
||||
Reference in New Issue
Block a user