Setup Assistant: Drop debounce function
The checkBlenderExePath function is now executed only once the Next button is pressed. This is the same behavior as for the storage selection step.
This commit is contained in:
parent
920420c10e
commit
3a0ace2122
@ -99,9 +99,9 @@
|
||||
|
||||
<step-item
|
||||
v-show="currentSetupStep == 3"
|
||||
@next-clicked="nextStep"
|
||||
@next-clicked="nextStepAfterCheckBlenderExePath"
|
||||
@back-clicked="prevStep"
|
||||
:is-next-clickable="selectedBlender != null && selectedBlender.is_usable"
|
||||
:is-next-clickable="selectedBlender != null || customBlenderExe != (null || '')"
|
||||
title="Blender"
|
||||
>
|
||||
|
||||
@ -178,8 +178,9 @@
|
||||
</div>
|
||||
<div>
|
||||
<input
|
||||
@input="checkBlenderExePath"
|
||||
v-model="customBlenderExe"
|
||||
@keyup.enter="nextStepAfterCheckBlenderExePath"
|
||||
@focus="selectedBlender = null"
|
||||
:class="{'is-invalid': blenderExeCheckResult != null && !blenderExeCheckResult.is_usable}"
|
||||
type="text"
|
||||
placeholder="Path to Blender"
|
||||
@ -193,8 +194,8 @@
|
||||
|
||||
<div v-if="autoFoundBlenders.length === 0">
|
||||
<input
|
||||
@input="checkBlenderExePath"
|
||||
v-model="customBlenderExe"
|
||||
@keyup.enter="nextStepAfterCheckBlenderExePath"
|
||||
:class="{'is-invalid': blenderExeCheckResult != null && !blenderExeCheckResult.is_usable}"
|
||||
type="text"
|
||||
placeholder="Path to Blender executable"
|
||||
@ -254,21 +255,6 @@ import StepItem from '@/components/steps/StepItem.vue';
|
||||
import { MetaApi, PathCheckInput, SetupAssistantConfig } from "@/manager-api";
|
||||
import { apiClient } from '@/stores/api-query-count';
|
||||
|
||||
function debounce(func, wait, immediate) {
|
||||
var timeout;
|
||||
return function() {
|
||||
var context = this, args = arguments;
|
||||
var later = function() {
|
||||
timeout = null;
|
||||
if (!immediate) func.apply(context, args);
|
||||
};
|
||||
var callNow = immediate && !timeout;
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
if (callNow) func.apply(context, args);
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'SetupAssistantView',
|
||||
components: {
|
||||
@ -362,6 +348,13 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
nextStepAfterCheckBlenderExePath() {
|
||||
this.checkBlenderExePath();
|
||||
if (this.selectedBlender != null && this.selectedBlender.is_usable) {
|
||||
this.nextStep();
|
||||
}
|
||||
},
|
||||
|
||||
findBlenderExePath() {
|
||||
this.isBlenderExeFinding = true;
|
||||
this.autoFoundBlenders = [];
|
||||
@ -462,9 +455,6 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.checkBlenderExePath = debounce(this.checkBlenderExePath, 200)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user