Skip to content

Commit c58289d

Browse files
authored
Merge pull request #183 from arduino/fix/stop-on-filemanager-switch
Fix/stop on filemanager switch
2 parents 8615b76 + 110193a commit c58289d

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

index.js

-2
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ app.on('ready', () => {
6565
createWindow()
6666

6767
win.on('focus', () => {
68-
console.log("win focus")
6968
})
7069

7170
win.on('blur', () => {
72-
console.log("win blur")
7371
})
7472

7573
})

ui/arduino/store.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ async function confirmDialog(msg, cancelMsg, confirmMsg) {
2424
cancelId: 1,
2525
message: msg
2626
})
27-
console.log('confirm', response)
2827
return Promise.resolve(response)
2928
}
3029

@@ -103,14 +102,17 @@ async function store(state, emitter) {
103102
}
104103
emitter.emit('render')
105104
})
105+
106106
emitter.on('change-view', (view) => {
107-
108107
if (state.view === 'file-manager') {
109108
if (view != state.view) {
110109
state.selectedFiles = []
111110
}
112111
emitter.emit('refresh-files')
113112
}
113+
if(view === 'file-manager') {
114+
emitter.emit('stop')
115+
}
114116
state.view = view
115117
emitter.emit('render')
116118
updateMenu()
@@ -158,7 +160,6 @@ async function store(state, emitter) {
158160
cancelId: 0,
159161
message: "Could not connect to the board. Reset it and try again."
160162
})
161-
console.log('Reset request acknowledged', response)
162163
emitter.emit('connection-timeout')
163164
}, 3500)
164165
try {
@@ -1194,7 +1195,6 @@ async function store(state, emitter) {
11941195
&& f.source == selectedFile.source
11951196
&& f.parentFolder == selectedFile.parentFolder
11961197
})
1197-
console.log('already open', alreadyOpen)
11981198

11991199
if (!alreadyOpen) {
12001200
// This file is not open yet,
@@ -1544,19 +1544,16 @@ async function store(state, emitter) {
15441544

15451545
function filterDoubleRun(onlySelected = false) {
15461546
if (preventDoubleRun) return
1547-
console.log('>>> RUN CODE ACTUAL <<<')
15481547
emitter.emit('run', onlySelected)
15491548
timedReset()
15501549
}
15511550

15521551
function runCode() {
1553-
console.log('>>> RUN CODE REQUEST <<<')
15541552
if (canExecute({ view: state.view, isConnected: state.isConnected })) {
15551553
filterDoubleRun()
15561554
}
15571555
}
15581556
function runCodeSelection() {
1559-
console.log('>>> RUN CODE REQUEST <<<')
15601557
if (canExecute({ view: state.view, isConnected: state.isConnected })) {
15611558
filterDoubleRun(true)
15621559
}
@@ -1629,13 +1626,12 @@ async function store(state, emitter) {
16291626
}
16301627
const tabExists = state.openFiles.find(f => f.parentFolder === newFile.parentFolder && f.fileName === newFile.fileName && f.source === newFile.source)
16311628
if (tabExists || fullPathExists) {
1632-
const confirmation = confirmDialog(`File ${newFile.fileName} already exists on ${source}. Please choose another name.`, 'OK')
1629+
const confirmation = await confirmDialog(`File ${newFile.fileName} already exists on ${source}. Please choose another name.`, 'OK')
16331630
return false
16341631
}
16351632
// LEAK > listeners keep getting added and not removed when tabs are closed
16361633
// additionally I found that closing a tab has actually added an extra listener
16371634
newFile.editor.onChange = function() {
1638-
console.log('editor has changes')
16391635
newFile.hasChanges = true
16401636
emitter.emit('render')
16411637
}

0 commit comments

Comments
 (0)