Skip to content

Commit

Permalink
Merge pull request #1317 from ProcessMaker/bugfix/FOUR-6888
Browse files Browse the repository at this point in the history
Fix debounce of updateDataInputNow and updateDataPreview methods
  • Loading branch information
caleeli authored Feb 17, 2023
2 parents 747e728 + 570f685 commit dd18af6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 8 additions & 6 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ export default {
return warnings;
},
},
created() {
this.updateDataInput = debounce(this.updateDataInput, 1000);
this.updateDataPreview = debounce(this.updateDataPreview, 1000);
},
mounted() {
this.countElements = debounce(this.countElements, 2000);
if (globalObject.ProcessMaker && globalObject.ProcessMaker.user && globalObject.ProcessMaker.user.lang) {
Expand All @@ -422,21 +426,19 @@ export default {
},
methods: {
...mapMutations("globalErrorsModule", { setStoreMode: "setMode" }),
// eslint-disable-next-line func-names
updateDataInput: debounce(function () {
updateDataInput() {
this.updateDataInputNow();
}, 1000),
},
updateDataInputNow() {
if (this.previewInputValid) {
// Copy data over
this.previewData = JSON.parse(this.previewInput);
this.updateDataPreview();
}
},
// eslint-disable-next-line func-names
updateDataPreview: debounce(function () {
updateDataPreview() {
this.previewDataStringify = JSON.stringify(this.previewData, null, 2);
}, 1000),
},
monacoMounted(editor) {
this.editor = editor;
this.editor.updateOptions({ readOnly: true });
Expand Down
1 change: 0 additions & 1 deletion src/mixins/ScreenBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export default {
},
async submitForm() {
await this.validateNow(findRootScreen(this));
console.log(this.valid__, this.message__);
if (!this.valid__) {
window.ProcessMaker.alert(this.message__, "danger");
// if the form is not valid the data is not emitted
Expand Down

0 comments on commit dd18af6

Please sign in to comment.