From 56ac3f84182d953e5d28609de0a57cbd0cb39669 Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Fri, 8 Nov 2024 16:33:44 +0000 Subject: [PATCH 1/6] catch block for checking fo updates warning about no model loaded, and no AVX2 support (mainly linux...) --- js/worker.js | 5 +++-- main.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/worker.js b/js/worker.js index 9551ec8..3a8f43e 100644 --- a/js/worker.js +++ b/js/worker.js @@ -395,8 +395,9 @@ async function handleMessage(e) { } case "analyse": { if (!predictWorkers.length) { - generateAlert({type: 'warning', - message: `A previous analysis resulted in an out-of-memory error, it is recommended you reduce the batch size from ${BATCH_SIZE}` + generateAlert({type: 'Error', + message: `The ${STATE.model} model has not loaded. Restart Chirpity to continue. If you see this message repeatedly, + it is likely your computer does not support AVX2 and Chirpity will not run on your system.` }) UI.postMessage({event: 'analysis-complete', quiet: true}); break; diff --git a/main.js b/main.js index d35e5f4..5d2b71f 100644 --- a/main.js +++ b/main.js @@ -479,7 +479,7 @@ app.whenReady().then(async () => { }); //Update handling autoUpdater.autoDownload = false; - autoUpdater.checkForUpdatesAndNotify() + autoUpdater.checkForUpdatesAndNotify().catch(error => console.warn('Error checking for updates', error)) // Allow multiple instances of Chirpity - experimental! This alone doesn't work: //app.releaseSingleInstanceLock() From 09c5e8e6c1af02f1cd870bf53e6c96f1729370a5 Mon Sep 17 00:00:00 2001 From: Mattk70 Date: Fri, 8 Nov 2024 16:59:34 +0000 Subject: [PATCH 2/6] STATE.hasNode set in worker --- js/worker.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/worker.js b/js/worker.js index fe7d23c..b148b44 100644 --- a/js/worker.js +++ b/js/worker.js @@ -642,8 +642,12 @@ async function spawnListWorker() { if (message === 'list-model-ready') { return resolve(worker); } else if (message === "tfjs-node") { - event.data.available || (STATE.detect.backend = 'webgpu'); - UI.postMessage({event: 'tfjs-node', hasNode: event.data.available}) + STATE.hasNode = true; + if (!event.data.available) { + STATE.detect.backend = 'webgpu'; + STATE.hasNode = false; + } + UI.postMessage({event: 'tfjs-node', hasNode: STATE.hasNode}) } }; From 3156e33fc12c51d38fbd49c5b9aa5a9847d7d202 Mon Sep 17 00:00:00 2001 From: mattk70 Date: Sat, 9 Nov 2024 11:19:16 +0000 Subject: [PATCH 3/6] Update handleGesture for mousewheel support --- js/ui.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui.js b/js/ui.js index f7f98e8..80dda6b 100644 --- a/js/ui.js +++ b/js/ui.js @@ -2108,7 +2108,8 @@ function getSpecies(target) { } function handleGesture(e) { - const key = e.deltaX > 0 ? 'PageDown' : 'PageUp'; + const moveDirectoion = e.deltaX || e.deltaY; // If deltaX is 0, use deltaY + const key = moveDirectoion > 0 ? 'PageDown' : 'PageUp'; console.log(`scrolling x: ${e.deltaX} y: ${e.deltaY}`) waitForFinalEvent(() => { GLOBAL_ACTIONS[key](e); From c9de8a69bc72399d0e40c4ea9e6dc3995a1a0b2a Mon Sep 17 00:00:00 2001 From: mattk70 Date: Sat, 9 Nov 2024 11:19:54 +0000 Subject: [PATCH 4/6] fix typo --- js/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui.js b/js/ui.js index 80dda6b..a45d0cd 100644 --- a/js/ui.js +++ b/js/ui.js @@ -2108,8 +2108,8 @@ function getSpecies(target) { } function handleGesture(e) { - const moveDirectoion = e.deltaX || e.deltaY; // If deltaX is 0, use deltaY - const key = moveDirectoion > 0 ? 'PageDown' : 'PageUp'; + const moveDirection = e.deltaX || e.deltaY; // If deltaX is 0, use deltaY + const key = moveDirection > 0 ? 'PageDown' : 'PageUp'; console.log(`scrolling x: ${e.deltaX} y: ${e.deltaY}`) waitForFinalEvent(() => { GLOBAL_ACTIONS[key](e); From 7bac94bd08caf3551ab34e9aad40d7fac0629e1a Mon Sep 17 00:00:00 2001 From: mattk70 Date: Sat, 9 Nov 2024 11:21:25 +0000 Subject: [PATCH 5/6] increase handlegesture timeout --- js/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui.js b/js/ui.js index a45d0cd..e525c60 100644 --- a/js/ui.js +++ b/js/ui.js @@ -2110,11 +2110,11 @@ function getSpecies(target) { function handleGesture(e) { const moveDirection = e.deltaX || e.deltaY; // If deltaX is 0, use deltaY const key = moveDirection > 0 ? 'PageDown' : 'PageUp'; - console.log(`scrolling x: ${e.deltaX} y: ${e.deltaY}`) + DEBUG && console.log(`scrolling x: ${e.deltaX} y: ${e.deltaY}`) waitForFinalEvent(() => { GLOBAL_ACTIONS[key](e); trackEvent(config.UUID, 'Swipe', key, '' ); - }, 100, 'swipe'); + }, 200, 'swipe'); } From adbd03315f00d8f565a9dfd120b63c412ce2ac56 Mon Sep 17 00:00:00 2001 From: mattk70 Date: Sat, 9 Nov 2024 11:22:12 +0000 Subject: [PATCH 6/6] config.debug --- js/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui.js b/js/ui.js index e525c60..cc0c431 100644 --- a/js/ui.js +++ b/js/ui.js @@ -2110,7 +2110,7 @@ function getSpecies(target) { function handleGesture(e) { const moveDirection = e.deltaX || e.deltaY; // If deltaX is 0, use deltaY const key = moveDirection > 0 ? 'PageDown' : 'PageUp'; - DEBUG && console.log(`scrolling x: ${e.deltaX} y: ${e.deltaY}`) + config.debug && console.log(`scrolling x: ${e.deltaX} y: ${e.deltaY}`) waitForFinalEvent(() => { GLOBAL_ACTIONS[key](e); trackEvent(config.UUID, 'Swipe', key, '' );