Skip to content
Snippets Groups Projects
Commit 3fff4b9d authored by Ron Lucke's avatar Ron Lucke Committed by Jan-Hendrik Willms
Browse files

fix #3830

Closes #3830

Merge request studip/studip!2699
parent d026a2f9
No related branches found
No related tags found
No related merge requests found
...@@ -780,7 +780,8 @@ export default { ...@@ -780,7 +780,8 @@ export default {
displayFeedback: false, displayFeedback: false,
showRatingPopup: false, showRatingPopup: false,
ratingPopupFeedbackElement: null ratingPopupFeedbackElement: null,
storing: false,
}; };
}, },
...@@ -1452,11 +1453,13 @@ export default { ...@@ -1452,11 +1453,13 @@ export default {
}), }),
initCurrent() { initCurrent() {
this.currentElement = _.cloneDeep(this.structuralElement); if (!this.storing) {
this.uploadFileError = ''; this.currentElement = _.cloneDeep(this.structuralElement);
this.deletingPreviewImage = false; this.uploadFileError = '';
this.uploadImageURL = null; this.deletingPreviewImage = false;
this.loadFeedback(); this.uploadImageURL = null;
this.loadFeedback();
}
}, },
async menuAction(action) { async menuAction(action) {
switch (action) { switch (action) {
...@@ -1559,6 +1562,7 @@ export default { ...@@ -1559,6 +1562,7 @@ export default {
} }
}, },
async storeCurrentElement() { async storeCurrentElement() {
this.storing = true;
await this.loadStructuralElement(this.currentElement.id); await this.loadStructuralElement(this.currentElement.id);
if (this.blockedByAnotherUser) { if (this.blockedByAnotherUser) {
this.companionWarning({ this.companionWarning({
...@@ -1568,6 +1572,7 @@ export default { ...@@ -1568,6 +1572,7 @@ export default {
) )
}); });
this.showElementEditDialog(false); this.showElementEditDialog(false);
this.storing = false;
return false; return false;
} }
if (!this.blocked) { if (!this.blocked) {
...@@ -1598,7 +1603,6 @@ export default { ...@@ -1598,7 +1603,6 @@ export default {
} }
this.showElementEditDialog(false); this.showElementEditDialog(false);
if (this.currentElement.attributes['release-date'] !== '') { if (this.currentElement.attributes['release-date'] !== '') {
this.currentElement.attributes['release-date'] = this.currentElement.attributes['release-date'] =
new Date(this.currentElement.attributes['release-date']).getTime() / 1000; new Date(this.currentElement.attributes['release-date']).getTime() / 1000;
...@@ -1618,6 +1622,7 @@ export default { ...@@ -1618,6 +1622,7 @@ export default {
await this.updateStructuralElement({ element, id: this.currentId}); await this.updateStructuralElement({ element, id: this.currentId});
await this.unlockObject({ id: this.currentId, type: 'courseware-structural-elements' }); await this.unlockObject({ id: this.currentId, type: 'courseware-structural-elements' });
this.$emit('select', this.currentId); this.$emit('select', this.currentId);
this.storing = false;
this.initCurrent(); this.initCurrent();
}, },
...@@ -1977,7 +1982,7 @@ export default { ...@@ -1977,7 +1982,7 @@ export default {
this.loadProgresses(); this.loadProgresses();
} }
if (this.inCourse) { if (this.inCourse && this.hasFeedbackElement) {
this.loadFeedbackElement({ id: this.feedbackElementId }); this.loadFeedbackElement({ id: this.feedbackElementId });
} }
}, },
......
...@@ -163,7 +163,7 @@ export default { ...@@ -163,7 +163,7 @@ export default {
watch: { watch: {
containers(oldValue, newValue) { containers(oldValue, newValue) {
if (newValue && oldValue.length !== newValue.length) { if (oldValue && newValue && oldValue.length !== newValue.length) {
this.resetAdderStorage(); this.resetAdderStorage();
} }
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment