Skip to content

Commit

Permalink
Fix indexedDB deletion modal
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-signal committed Feb 13, 2024
1 parent 9ad6d5b commit 5ba3ed1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion background.html
Expand Up @@ -92,7 +92,7 @@
</head>
<body class="overflow-hidden">
<div id="app-container">
<div class="app-loading-screen app-loading-screen--without-titlebar">
<div class="app-loading-screen app-loading-screen--before-app-load">
<div class="module-title-bar-drag-area"></div>

<div class="module-splash-screen__logo module-img--150"></div>
Expand Down
5 changes: 0 additions & 5 deletions stylesheets/_global.scss
Expand Up @@ -265,11 +265,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.
*/
Expand Down
3 changes: 2 additions & 1 deletion stylesheets/_titlebar.scss
Expand Up @@ -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));
}
}
1 change: 1 addition & 0 deletions ts/background.ts
Expand Up @@ -645,6 +645,7 @@ export async function startApp(): Promise<void> {
await new Promise<void>((resolve, reject) => {
showConfirmationDialog({
dialogName: 'deleteOldIndexedDBData',
noMouseClose: true,
onTopOfEverything: true,
cancelText: window.i18n('icu:quit'),
confirmStyle: 'negative',
Expand Down
6 changes: 4 additions & 2 deletions ts/util/showConfirmationDialog.tsx
Expand Up @@ -13,6 +13,7 @@ type ConfirmationDialogViewProps = {
title: string;
description?: string;
okText: string;
noMouseClose?: boolean;
reject?: (error: Error) => void;
resolve: () => void;
};
Expand All @@ -25,7 +26,7 @@ function removeConfirmationDialog() {
return;
}

window.reduxActions.globalModals.toggleConfirmationModal(false);
window.reduxActions?.globalModals.toggleConfirmationModal(false);

unmountComponentAtNode(confirmationDialogViewNode);
document.body.removeChild(confirmationDialogViewNode);
Expand All @@ -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);
Expand Down Expand Up @@ -77,6 +78,7 @@ export function showConfirmationDialog(
removeConfirmationDialog();
}}
title={options.title}
noMouseClose={options.noMouseClose}
>
{options.description}
</ConfirmationDialog>,
Expand Down

0 comments on commit 5ba3ed1

Please sign in to comment.