Skip to content
This repository was archived by the owner on Feb 12, 2021. It is now read-only.

Commit a428cc1

Browse files
ryaniowolovim
authored andcommitted
fix: disable switch on initial toggle (#521)
1 parent 4a1ffc5 commit a428cc1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ui/nano.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@
458458
data: function() {
459459
return {
460460
isSwitched: false,
461+
switchDisabled: false,
461462
pluginVersion: '',
462463
state: '',
463464
isDownloading: false,
@@ -470,7 +471,7 @@
470471
template: `
471472
<div>
472473
<div class="plugin-item">
473-
<b-switch v-model="isSwitched" @input="handleChange($event)" size="is-small"></b-switch>
474+
<b-switch v-model="isSwitched" @input="handleChange($event)" size="is-small" :disabled="switchDisabled"></b-switch>
474475
<span class="plugin-name centered" v-on:click="openUI()">{{ plugin.displayName }}</span>
475476
<span class="plugin-profile centered">{{ plugin.profile }}</span>
476477
<span class="plugin-info centered">
@@ -517,8 +518,13 @@
517518
if (state === 'started') {
518519
this.plugin.errors = []
519520
}
521+
522+
if (['started', 'connected', 'stopped', 'error'].includes(state)) {
523+
this.switchDisabled = false
524+
}
520525
},
521526
handleSwitchedOn: async function() {
527+
this.switchDisabled = true
522528
const persistedFlags = (await Grid.Config.getItem('flags')) || {}
523529
const flags = persistedFlags[this.plugin.pluginRef.name]
524530
const setupHandler = event => {

0 commit comments

Comments
 (0)