Skip to content

Commit 9b0285a

Browse files
committed
File Manager view triggers file-list on switch.
Signed-off-by: ubi de feo <me@ubidefeo.com>
1 parent c58289d commit 9b0285a

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ dist/
77
.vscode
88
.npmrc
99
Resources
10-
temp
10+
temp
11+
claude

ui/arduino/store.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const newFileContent = `# This program was created in Arduino Lab for MicroPytho
99
1010
print('Hello, MicroPython!')
1111
`
12+
async function sleep(ms) {
13+
return new Promise(resolve => setTimeout(resolve, ms));
14+
}
1215

1316
async function confirmDialog(msg, cancelMsg, confirmMsg) {
1417
// cancelMsg = cancelMsg || 'Cancel'
@@ -103,15 +106,16 @@ async function store(state, emitter) {
103106
emitter.emit('render')
104107
})
105108

106-
emitter.on('change-view', (view) => {
107-
if (state.view === 'file-manager') {
108-
if (view != state.view) {
109-
state.selectedFiles = []
110-
}
111-
emitter.emit('refresh-files')
109+
emitter.on('change-view', async (view) => {
110+
if (state.view === view) {
111+
return
112+
} else {
113+
state.selectedFiles = []
112114
}
113115
if(view === 'file-manager') {
114116
emitter.emit('stop')
117+
await sleep(500)
118+
emitter.emit('refresh-files')
115119
}
116120
state.view = view
117121
emitter.emit('render')

0 commit comments

Comments
 (0)
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