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 committed Dec 7, 2023
1 parent c804dd5 commit a2267c0
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 a2267c0

Please sign in to comment.