From 9b0285a6b5e731fc50fbcb2e515b422f9e61dae6 Mon Sep 17 00:00:00 2001 From: ubi de feo Date: Fri, 11 Apr 2025 16:16:58 +0200 Subject: [PATCH 1/3] File Manager view triggers file-list on switch. Signed-off-by: ubi de feo --- .gitignore | 3 ++- ui/arduino/store.js | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index c4b0f7e..ea7bad6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ dist/ .vscode .npmrc Resources -temp \ No newline at end of file +temp +claude \ No newline at end of file diff --git a/ui/arduino/store.js b/ui/arduino/store.js index 04889b4..9029a12 100644 --- a/ui/arduino/store.js +++ b/ui/arduino/store.js @@ -9,6 +9,9 @@ const newFileContent = `# This program was created in Arduino Lab for MicroPytho print('Hello, MicroPython!') ` +async function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} async function confirmDialog(msg, cancelMsg, confirmMsg) { // cancelMsg = cancelMsg || 'Cancel' @@ -103,15 +106,16 @@ async function store(state, emitter) { emitter.emit('render') }) - emitter.on('change-view', (view) => { - if (state.view === 'file-manager') { - if (view != state.view) { - state.selectedFiles = [] - } - emitter.emit('refresh-files') + emitter.on('change-view', async (view) => { + if (state.view === view) { + return + } else { + state.selectedFiles = [] } if(view === 'file-manager') { emitter.emit('stop') + await sleep(500) + emitter.emit('refresh-files') } state.view = view emitter.emit('render') From efd83500917a128ac9488340f91ec04a6426630f Mon Sep 17 00:00:00 2001 From: ubi de feo Date: Mon, 14 Apr 2025 09:11:24 +0200 Subject: [PATCH 2/3] Removed .gitignore entry in favour of local personal configuration. Signed-off-by: ubi de feo --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ea7bad6..c4b0f7e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,4 @@ dist/ .vscode .npmrc Resources -temp -claude \ No newline at end of file +temp \ No newline at end of file From f057b1547caeee38876a86a27be4515623d4475e Mon Sep 17 00:00:00 2001 From: ubi de feo Date: Tue, 15 Apr 2025 10:51:26 +0200 Subject: [PATCH 3/3] Amended sleep with comment from Sebastian's feedback. Signed-off-by: ubi de feo --- ui/arduino/store.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/arduino/store.js b/ui/arduino/store.js index 9029a12..f82c992 100644 --- a/ui/arduino/store.js +++ b/ui/arduino/store.js @@ -114,7 +114,7 @@ async function store(state, emitter) { } if(view === 'file-manager') { emitter.emit('stop') - await sleep(500) + await sleep(250) // Give the board time to stop the program and return to the prompt emitter.emit('refresh-files') } state.view = view pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy