Skip to content

Commit

Permalink
core: frontend: tweak arming/disarming logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Williangalvani committed Jan 23, 2024
1 parent 35ff644 commit e77593b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/frontend/src/components/vehiclesetup/PwmSetup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</th>
<th>
<v-switch
v-model="is_armed"
v-model="desired_armed_state"
:loading="desired_armed_state !== (is_armed) ? 'warning' : null"
:disabled="!is_manual"
class="mx-1 flex-grow-0"
Expand Down Expand Up @@ -415,10 +415,9 @@ export default Vue.extend({
console.warn('Disarming failed!')
}, 5000)
},
arm_disarm_switch_change(): void {
this.desired_armed_state = !this.is_armed
arm_disarm_switch_change(should_arm: boolean): void {
// eslint-disable-next-line no-unused-expressions
this.is_armed ? this.disarm() : this.arm()
should_arm ? this.arm() : this.disarm()
},
armDisarm(arm: boolean, force: boolean): void {
mavlink2rest.sendMessage(
Expand Down

0 comments on commit e77593b

Please sign in to comment.