Skip to content

Commit d64d862

Browse files
authored
Merge pull request #2976 from Chia-Network/checkpoint/main_from_release_2.7.3_e71ee50d32a5a88692397978db6217aaa5faa951
checkpoint: into main from release/2.7.3 @ e71ee50
2 parents 6452bcb + 0cf06c0 commit d64d862

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

packages/gui/src/electron/utils/openReactDialog.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,25 @@ export default function openReactDialog<TResponse, TProps extends object>(
309309
// open dev tools
310310
// dialog.webContents.openDevTools();
311311

312-
dialog.once('ready-to-show', () => dialog.show());
312+
// Reveal the dialog. `ready-to-show` is the preferred fast path, but on some
313+
// compositors (notably Wayland/mutter) that event can fail to fire, which
314+
// would otherwise leave the dialog hidden forever even though the page has
315+
// loaded. Guard the show in a once-only helper and back it with
316+
// `did-finish-load` and a timeout fallback so the dialog is always revealed.
317+
let hasShownDialog = false;
318+
const showDialog = () => {
319+
// Latch the flag only after a successful `show()` so a failed attempt
320+
// doesn't block the other triggers.
321+
if (hasShownDialog || dialog.isDestroyed()) {
322+
return;
323+
}
324+
dialog.show();
325+
hasShownDialog = true;
326+
};
327+
328+
dialog.once('ready-to-show', showDialog);
329+
dialog.webContents.once('did-finish-load', showDialog);
330+
setTimeout(showDialog, 5000);
313331

314332
if (hideMenu) {
315333
dialog.setMenu(null);

0 commit comments

Comments
 (0)