mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
fix(desktop): update from the splash only after the user clicks (#3280)
This commit is contained in:
1 parent
f1373a63c3
commit
7937d5f802
90 files changed
+6888
-11255
No files matched your search
@@ -3,6 +3,7 @@
|
||||
const {ipcRenderer} = require('electron');
|
||||
|
||||
const SPLASH_STATE_CHANNEL = 'desktop-splash:state';
|
||||
const SPLASH_REVEALED_CHANNEL = 'desktop-splash:revealed';
|
||||
const SPLASH_READY_CHANNEL = 'desktop-splash:ready';
|
||||
const SPLASH_RETRY_CHANNEL = 'desktop-splash:retry-now';
|
||||
const SPLASH_QUIT_CHANNEL = 'desktop-splash:quit';
|
||||
@@ -87,7 +88,7 @@ let renderedLayout = null;
|
||||
let renderedManualSignature = null;
|
||||
let countdownTimer = null;
|
||||
let selectedOption = null;
|
||||
let splashStartedAt = Date.now();
|
||||
let splashStartedAt = Number.POSITIVE_INFINITY;
|
||||
let diagnosticsRevealTimer = null;
|
||||
let diagnosticsCopiedTimer = null;
|
||||
|
||||
@@ -592,12 +593,24 @@ function afterNextPaint(callback) {
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
function restartDiagnosticsReveal() {
|
||||
splashStartedAt = Date.now();
|
||||
if (diagnosticsRevealTimer != null) clearTimeout(diagnosticsRevealTimer);
|
||||
diagnosticsRevealTimer = setTimeout(() => {
|
||||
diagnosticsRevealTimer = null;
|
||||
render();
|
||||
}, DIAGNOSTICS_REVEAL_MS);
|
||||
}
|
||||
|
||||
ipcRenderer.on(SPLASH_REVEALED_CHANNEL, () => {
|
||||
restartDiagnosticsReveal();
|
||||
render();
|
||||
});
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
if (!/(?:^|[?&])held=1(?:&|$)/.test(window.location?.search ?? '')) {
|
||||
restartDiagnosticsReveal();
|
||||
}
|
||||
render();
|
||||
const mount = document.getElementById(SPLASH_MOUNT_ID);
|
||||
const branded = mount == null ? Promise.resolve() : waitForBranding(mount);
|
||||
|
||||
Reference in new issue
Block a user