From 7d8cb279be78966144c32596bdd30e0afe7a7d9a Mon Sep 17 00:00:00 2001 From: automated-signal <37887102+automated-signal@users.noreply.github.com> Date: Wed, 14 Feb 2024 14:22:17 -0600 Subject: [PATCH] Fix indexedDB deletion modal Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com> --- background.html | 2 +- stylesheets/_global.scss | 5 ----- stylesheets/_titlebar.scss | 3 ++- ts/background.ts | 1 + ts/util/showConfirmationDialog.tsx | 6 ++++-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/background.html b/background.html index 48425b0db..9bc00e833 100644 --- a/background.html +++ b/background.html @@ -92,7 +92,7 @@
-
+
diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss index be5d959f0..86765059b 100644 --- a/stylesheets/_global.scss +++ b/stylesheets/_global.scss @@ -274,11 +274,6 @@ $loading-height: 16px; padding-block: 0; padding-inline: 16px; - &--without-titlebar { - /* There is no titlebar during loading screen on Windows */ - -webkit-app-region: drag; - } - /* Note: background-color is intentionally transparent until body has the * theme class. */ diff --git a/stylesheets/_titlebar.scss b/stylesheets/_titlebar.scss index 22d767411..8df95bfcc 100644 --- a/stylesheets/_titlebar.scss +++ b/stylesheets/_titlebar.scss @@ -10,7 +10,8 @@ body { // It'd be great if we could use the `:fullscreen` selector here, but that does not seem // to work with Electron, at least on macOS. --title-bar-drag-area-height: 0px; // Needs to have a unit to work with `calc()`. - &.os-macos:not(.full-screen) { + &.os-macos:not(.full-screen), + .app-loading-screen--before-app-load { --title-bar-drag-area-height: calc(28px / var(--zoom-factor)); } } diff --git a/ts/background.ts b/ts/background.ts index bd17933ad..c228400d9 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -645,6 +645,7 @@ export async function startApp(): Promise { await new Promise((resolve, reject) => { showConfirmationDialog({ dialogName: 'deleteOldIndexedDBData', + noMouseClose: true, onTopOfEverything: true, cancelText: window.i18n('icu:quit'), confirmStyle: 'negative', diff --git a/ts/util/showConfirmationDialog.tsx b/ts/util/showConfirmationDialog.tsx index c339c1435..9db08e9a8 100644 --- a/ts/util/showConfirmationDialog.tsx +++ b/ts/util/showConfirmationDialog.tsx @@ -13,6 +13,7 @@ type ConfirmationDialogViewProps = { title: string; description?: string; okText: string; + noMouseClose?: boolean; reject?: (error: Error) => void; resolve: () => void; }; @@ -25,7 +26,7 @@ function removeConfirmationDialog() { return; } - window.reduxActions.globalModals.toggleConfirmationModal(false); + window.reduxActions?.globalModals.toggleConfirmationModal(false); unmountComponentAtNode(confirmationDialogViewNode); document.body.removeChild(confirmationDialogViewNode); @@ -46,7 +47,7 @@ export function showConfirmationDialog( removeConfirmationDialog(); } - window.reduxActions.globalModals.toggleConfirmationModal(true); + window.reduxActions?.globalModals.toggleConfirmationModal(true); confirmationDialogViewNode = document.createElement('div'); document.body.appendChild(confirmationDialogViewNode); @@ -77,6 +78,7 @@ export function showConfirmationDialog( removeConfirmationDialog(); }} title={options.title} + noMouseClose={options.noMouseClose} > {options.description} ,