Skip to content

Commit 1d75277

Browse files
committed
Don't open port dialog on disconnect
1 parent 3845458 commit 1d75277

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ui/arduino/components/toolbar.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ function Toolbar(state, emit) {
33
icon: state.isConnected ? 'icons/Connect.svg' : 'icons/Disconnect.svg',
44
label: state.isConnected ? 'Disconnect' : 'Connect',
55
disabled: false,
6-
onclick: () => emit('open-port-dialog'),
7-
color: 'default'
6+
color: 'default',
7+
onclick: () => {
8+
if (state.isConnected) {
9+
emit('disconnect')
10+
} else {
11+
emit('open-port-dialog')
12+
}
13+
},
814
})
915

1016
const play = Button({

0 commit comments

Comments
 (0)