Compare commits

..

2 Commits

Author SHA1 Message Date
Administrator
90ba69d1b0 release: v3.0.6 2026-04-19 23:20:44 +02:00
Administrator
c5c31aa323 fix(ui): log-fallback warning is a toast, not a blocking alert()
alert() in Electron halts the renderer main thread until the user
clicks OK — the upload table, status bar and progress all freeze.
During a 170-file batch the dialog popped up mid-upload and froze
everything for however long the user took to dismiss it (which is
why stats updates lagged to one every 3-5s instead of the usual 1s
cadence).

Replaced with the same showCopyToast used elsewhere, with an 8s
duration so the message is still readable. showCopyToast now accepts
an optional durationMs argument.
2026-04-19 23:20:17 +02:00
2 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "multi-hoster-uploader",
"version": "3.0.5",
"version": "3.0.6",
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
"main": "main.js",
"scripts": {

View File

@ -118,7 +118,11 @@ async function init() {
});
window.api.onShutdownCountdown(handleShutdownCountdown);
window.api.onUploadLogFallback((data) => {
alert('Der konfigurierte Log-Pfad konnte nicht beschrieben werden.\n\nNeue Einträge werden zwischenzeitlich hier gespeichert:\n' + (data && data.fallbackPath ? data.fallbackPath : '(Fallback)') + '\n\nBitte in den Einstellungen einen gültigen Pfad setzen.');
// Non-blocking toast instead of alert() — alert() in Electron halts the
// entire renderer main thread (including the upload table) until the user
// clicks OK. During a big batch that freezes everything.
const path = data && data.fallbackPath ? data.fallbackPath : '(Fallback)';
showCopyToast(`Log-Pfad nicht beschreibbar — schreibe nach: ${path}`, 8000);
});
window.api.onAccountRotationLog((entry) => {
// Surface only the user-visible rotation events as toasts; full detail
@ -3891,12 +3895,12 @@ function escapeAttr(str) {
return String(str).replace(_ATTR_ESC_RE, (c) => _ATTR_ESC_MAP[c]);
}
function showCopyToast(msg) {
function showCopyToast(msg, durationMs) {
const toast = document.getElementById('copyToast');
toast.textContent = msg;
toast.classList.add('show');
clearTimeout(toast._timer);
toast._timer = setTimeout(() => toast.classList.remove('show'), 1500);
toast._timer = setTimeout(() => toast.classList.remove('show'), durationMs || 1500);
}
// --- Resize handle for recent-files panel ---