Skip to content

Commit

Permalink
minor fix for different cases of save all
Browse files Browse the repository at this point in the history
  • Loading branch information
khansadaoudi committed Jul 29, 2024
1 parent 7a77d83 commit 288e08d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/sentence/SentenceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ export default defineComponent({
this.sentenceBus.emit('action:saved', {
userId: this.openTabUser,
});
this.removePendingModification(`${this.sentence.sent_id}_${this.openTabUser}`);
this.reloadCommits += 1;
if (this.sentenceData.conlls[changedConllUser]) {
// the user already had a tree
Expand All @@ -552,7 +553,6 @@ export default defineComponent({
this.openTabUser = changedConllUser;
this.exportedConll = exportedConll;
}
this.removePendingModification(`${this.sentence.sent_id}_${this.openTabUser}`);
notifyMessage({ position: 'top', message: 'Saved on the server', icon: 'save' });
}
})
Expand Down
7 changes: 6 additions & 1 deletion src/components/sentence/VueDepTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default defineComponent({
this.statusChangeHandler();
},
methods: {
...mapActions(useGrewSearchStore, ['addPendingModification']),
...mapActions(useGrewSearchStore, ['addPendingModification', 'removePendingModification']),
svgClickHandler(e: svgClickEvent_t) {
const clickedId = e.detail.clicked;
const clickedToken = { ...this.sentenceSVG.treeJson.nodesJson[clickedId] };
Expand Down Expand Up @@ -284,6 +284,11 @@ export default defineComponent({
`${ this.reactiveSentencesObj[this.treeUserId].state.metaJson.sent_id }_${this.reactiveSentencesObj[this.treeUserId].state.metaJson.user_id }`,
this.reactiveSentencesObj[this.treeUserId].exportConll()
);
else {
this.removePendingModification(`${
this.reactiveSentencesObj[this.treeUserId].state.metaJson.sent_id }_${this.reactiveSentencesObj[this.treeUserId].state.metaJson.user_id }`
);
}
this.$emit('statusChanged', {
canUndo,
Expand Down

0 comments on commit 288e08d

Please sign in to comment.