mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-16 15:17:21 -05:00
updated debug
This commit is contained in:
9
main.js
9
main.js
@@ -84,6 +84,7 @@ function getReplacementsConfig() {
|
||||
|
||||
const updateClient = new UpdateClient(APPDATA_DIR);
|
||||
const fileUpdater = new FileUpdater(APPDATA_DIR, updateClient);
|
||||
fileUpdater.onNotice = (message) => sendToTauri('notice', { message });
|
||||
let lastFilePercent = -1;
|
||||
fileUpdater.onProgress = (downloaded, total) => {
|
||||
const percent = total > 0 ? Math.round((downloaded / total) * 100) : 0;
|
||||
@@ -222,7 +223,7 @@ async function start() {
|
||||
debugLog(`Update check finished. Found: ${release ? release.version : 'None'}`);
|
||||
} catch (e) {
|
||||
debugLog(`Update check failed (offline?): ${e.message}`);
|
||||
sendToTauri('status', { message: `Update server check skipped (${e.message})` });
|
||||
sendToTauri('notice', { message: `Update check skipped: ${e.message}` });
|
||||
}
|
||||
|
||||
const normalizeVer = (v) => (v || '').toString().replace(/^v/, '').trim();
|
||||
@@ -293,10 +294,12 @@ async function start() {
|
||||
const [filesCheck, sdkCheck] = await Promise.all([
|
||||
withTimeout(fileUpdater.checkRepos().catch((e) => {
|
||||
debugLog(`Live file check failed: ${e.message}`);
|
||||
sendToTauri('notice', { message: `File check failed: ${e.message}` });
|
||||
return null;
|
||||
}), 60000),
|
||||
}), 240000),
|
||||
withTimeout(fileUpdater.checkSdk().catch((e) => {
|
||||
debugLog(`SDK check failed: ${e.message}`);
|
||||
sendToTauri('notice', { message: `SDK check failed: ${e.message}` });
|
||||
return null;
|
||||
}), 12000)
|
||||
]);
|
||||
@@ -311,7 +314,7 @@ async function start() {
|
||||
sendToTauri('status', { message: `Updated ${filesCheck.changes.length} file(s).` });
|
||||
} catch (e) {
|
||||
debugLog(`File update failed: ${e.message}`);
|
||||
sendToTauri('status', { message: `File update failed: ${e.message}` });
|
||||
sendToTauri('notice', { message: `File update failed: ${e.message}` });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user