Skip to content

Commit

Permalink
Merge pull request #145 from hasanheroglu/fix-slow-editor
Browse files Browse the repository at this point in the history
process td only after save
  • Loading branch information
egekorkan authored Apr 14, 2023
2 parents 58726f0 + 3af064e commit b6b19a4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/components/03_organisms/oEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
:btnActive="td.length > 0"
/>
<aButtonBasic
v-on:save-td="$store.commit('SidebarStore/saveTd', { content: td, id })"
v-on:save-td="onSaveTd"
:btnClass="saveTdBtn.btnClass"
:btnLabel="saveTdBtn.btnLabel"
:btnOnClick="saveTdBtn.btnOnClick"
Expand Down Expand Up @@ -89,13 +89,13 @@ export default Vue.extend({
get(): string {
return this.td;
},
async set(value: string) {
this.tdChanged({ td: value });
set(value: string) {
this.td = getFormattedJsonString(value);
}
}
},
methods: {
...mapMutations('SidebarStore', ['saveTdProtocols']),
...mapMutations('SidebarStore', ['saveTdProtocols', 'saveTd']),
...mapActions('TdStore', [
'resetInteractions',
'resetSelections',
Expand Down Expand Up @@ -126,10 +126,6 @@ export default Vue.extend({
});
// Hide url bar if td changed
this.$emit('hide-url-bar');
// Reset result fields and interaction fields
(this as any).resetInteractions();
(this as any).resetSelections();
(this as any).resetResults();
// Update possible protocol list
this.$eventHub.$emit('selections-reseted');
},
Expand Down Expand Up @@ -160,6 +156,10 @@ export default Vue.extend({
} else {
// event not relevant for this function
}
},
onSaveTd() {
(this as any).saveTd({ content: this.td, id: this.id });
this.tdChanged({ td: this.td });
}
},
watch: {
Expand Down
43 changes: 41 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3266,6 +3266,11 @@ call-bind@^1.0.0:
function-bind "^1.1.1"
get-intrinsic "^1.0.2"

call-me-maybe@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa"
integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==

callsites@^3.0.0:
version "3.1.0"
resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz"
Expand Down Expand Up @@ -5759,6 +5764,11 @@ form-data@~2.3.2:
combined-stream "^1.0.6"
mime-types "^2.1.12"

format-util@^1.0.3:
version "1.0.5"
resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271"
integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg==

[email protected]:
version "0.2.0"
resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz"
Expand Down Expand Up @@ -6912,9 +6922,9 @@ js-tokens@^4.0.0:
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

js-yaml@^3.13.1:
js-yaml@^3.12.1, js-yaml@^3.13.1:
version "3.14.1"
resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537"
integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==
dependencies:
argparse "^1.0.7"
Expand Down Expand Up @@ -6962,6 +6972,23 @@ json-placeholder-replacer@^1.0.35:
resolved "https://registry.npmjs.org/json-placeholder-replacer/-/json-placeholder-replacer-1.0.35.tgz"
integrity sha512-edlSWqcFVUpKPshaIcJfXpQ8eu0//gk8iU6XHWkCZIp5QEp4hoCFR7uk+LrIzhLTSqmBQ9VBs+EYK8pvWGEpRg==

json-schema-faker@^0.5.0-rcv.46:
version "0.5.0-rcv.46"
resolved "https://registry.yarnpkg.com/json-schema-faker/-/json-schema-faker-0.5.0-rcv.46.tgz#5f9eff94f463c337a361044a460cc46797ceb053"
integrity sha512-Q+sGrxptZfezwm7M9W9VmHT9E8s5fWPCaRC4J2zUjb3CmDsxokiCBdHdS/psu91Tafc/ITv+GtIztGzUVT2zIg==
dependencies:
json-schema-ref-parser "^6.1.0"
jsonpath-plus "^5.1.0"

json-schema-ref-parser@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/json-schema-ref-parser/-/json-schema-ref-parser-6.1.0.tgz#30af34aeab5bee0431da805dac0eb21b574bf63d"
integrity sha512-pXe9H1m6IgIpXmE5JSb8epilNTGsmTb2iPohAXpOdhqGFbQjNeHHsZxU+C8w6T81GZxSPFLeUoqDJmzxx5IGuw==
dependencies:
call-me-maybe "^1.0.1"
js-yaml "^3.12.1"
ono "^4.0.11"

json-schema-traverse@^0.4.1:
version "0.4.1"
resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz"
Expand Down Expand Up @@ -7045,6 +7072,11 @@ jsonparse@^1.3.1:
resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz"
integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==

jsonpath-plus@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/jsonpath-plus/-/jsonpath-plus-5.1.0.tgz#2fc4b2e461950626c98525425a3a3518b85af6c3"
integrity sha512-890w2Pjtj0iswAxalRlt2kHthi6HKrXEfZcn+ZNZptv7F3rUGIeDuZo+C+h4vXBHLEsVjJrHeCm35nYeZLzSBQ==

jsprim@^1.2.2:
version "1.4.2"
resolved "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz"
Expand Down Expand Up @@ -8133,6 +8165,13 @@ onetime@^5.1.0, onetime@^5.1.2:
dependencies:
mimic-fn "^2.1.0"

ono@^4.0.11:
version "4.0.11"
resolved "https://registry.yarnpkg.com/ono/-/ono-4.0.11.tgz#c7f4209b3e396e8a44ef43b9cedc7f5d791d221d"
integrity sha512-jQ31cORBFE6td25deYeD80wxKBMj+zBmHTrVxnc6CKhx8gho6ipmWM5zj/oeoqioZ99yqBls9Z/9Nss7J26G2g==
dependencies:
format-util "^1.0.3"

open@^6.3.0:
version "6.4.0"
resolved "https://registry.npmjs.org/open/-/open-6.4.0.tgz"
Expand Down

0 comments on commit b6b19a4

Please sign in to comment.