You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ui/arduino/store.js
+27-14Lines changed: 27 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,19 @@ const newFileContent = `# This program was created in Arduino Lab for MicroPytho
8
8
print('Hello, MicroPython!')
9
9
`
10
10
11
+
asyncfunctionconfirm(msg,cancelMsg,confirmMsg){
12
+
cancelMsg=cancelMsg||'Cancel'
13
+
confirmMsg=confirmMsg||'Yes'
14
+
letresponse=awaitwin.openDialog({
15
+
type: 'question',
16
+
buttons: [cancelMsg,confirmMsg],
17
+
cancelId: 0,
18
+
message: msg
19
+
})
20
+
console.log('confirm',response)
21
+
returnPromise.resolve(response)
22
+
}
23
+
11
24
asyncfunctionstore(state,emitter){
12
25
win.setWindowSize(720,640)
13
26
@@ -313,7 +326,7 @@ async function store(state, emitter) {
313
326
}
314
327
315
328
if(willOverwrite){
316
-
constconfirmation=confirm(`You are about to overwrite the file ${openFile.fileName} on your ${openFile.source}.\n\n Are you sure you want to proceed?`,'Cancel','Yes')
329
+
constconfirmation=awaitconfirm(`You are about to overwrite the file ${openFile.fileName} on your ${openFile.source}.\n\n Are you sure you want to proceed?`,'Cancel','Yes')
317
330
if(!confirmation){
318
331
state.isSaving=false
319
332
openFile.parentFolder=oldParentFolder
@@ -366,11 +379,11 @@ async function store(state, emitter) {
@@ -913,7 +926,7 @@ async function store(state, emitter) {
913
926
}
914
927
915
928
if(willOverwrite){
916
-
constconfirmation=confirm(`You are about to overwrite the file ${openFile.fileName} on your ${openFile.source}.\n\n Are you sure you want to proceed?`,'Cancel','Yes')
929
+
constconfirmation=awaitconfirm(`You are about to overwrite the file ${openFile.fileName} on your ${openFile.source}.\n\n Are you sure you want to proceed?`,'Cancel','Yes')
917
930
if(!confirmation){
918
931
state.renamingTab=null
919
932
state.isSaving=false
@@ -1175,7 +1188,7 @@ async function store(state, emitter) {
0 commit comments