Skip to content

Commit

Permalink
joystick-config-view: Use setTimeout instead of nextTick to reloa…
Browse files Browse the repository at this point in the history
…d joystick image

This way, if the input is unmapped by the check routines (in the controller store), it will be right in the end.
  • Loading branch information
rafaellehmkuhl authored and patrickelectric committed Dec 8, 2023
1 parent 342ca89 commit 40a203c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/views/ConfigurationJoystickView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,7 @@
</template>

<script setup lang="ts">
import { ref, watch } from 'vue'
import { onMounted } from 'vue'
import { onUnmounted } from 'vue'
import { computed } from 'vue'
import { nextTick } from 'vue'
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import Button from '@/components/Button.vue'
import JoystickPS from '@/components/joysticks/JoystickPS.vue'
Expand Down Expand Up @@ -318,7 +314,7 @@ const updateButtonAction = (input: JoystickInput, action: ProtocolAction): void
input.id
].action = action
showJoystickLayout.value = false
nextTick(() => (showJoystickLayout.value = true))
setTimeout(() => (showJoystickLayout.value = true), 3000)
buttonFunctionAssignmentFeedback.value = `Button ${input.id} remapped to function '${action.name}'.`
showButtonFunctionAssignmentFeedback.value = true
setTimeout(() => (showButtonFunctionAssignmentFeedback.value = false), 5000)
Expand Down

0 comments on commit 40a203c

Please sign in to comment.