Skip to content

Commit

Permalink
Debounce onChange calls to avoid unnecessary tool rebuilding
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Nov 15, 2024
1 parent ed0e0d2 commit 2b5d16a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/src/components/Tool/ToolForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ import ToolEntryPoints from "components/ToolEntryPoints/ToolEntryPoints";
import { mapActions, mapState, storeToRefs } from "pinia";
import { useHistoryItemsStore } from "stores/historyItemsStore";
import { useJobStore } from "stores/jobStore";
import { debounce } from "underscore";
import { refreshContentsWrapper } from "utils/data";
import { canMutateHistory } from "@/api";
Expand Down Expand Up @@ -287,7 +288,7 @@ export default {
this.onUpdate();
}
},
onUpdate() {
onUpdate: debounce(function (e) {
this.disabled = true;
console.debug("ToolForm - Updating input parameters.", this.formData);
updateToolFormData(this.formConfig.id, this.currentVersion, this.history_id, this.formData)
Expand All @@ -297,7 +298,7 @@ export default {
.finally(() => {
this.disabled = false;
});
},
}, 500),
onChangeVersion(newVersion) {
this.requestTool(newVersion);
},
Expand Down

0 comments on commit 2b5d16a

Please sign in to comment.