1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-21 22:29:41 +02:00

Handle edge case of self-approving sections changes

Prevents double-submission bug leading to section being hidden from view.
This commit is contained in:
Harvey Kandola 2018-11-21 11:53:12 +00:00
parent d499888cfd
commit 7428199fdd

View file

@ -83,9 +83,17 @@ export default Controller.extend(Tooltips, Notifier, {
let documentId = document.get('id'); let documentId = document.get('id');
let constants = this.get('constants'); let constants = this.get('constants');
// if document approval mode is locked return // Cannot change locked documents.
if (document.get('protection') === constants.ProtectionType.Lock) { if (document.get('protection') === constants.ProtectionType.Lock) {
// should not really happen return;
}
// Detect stale data situation and reload page.
// Happens when you are saving section edits that
// has just been approved.
// TODO: really need a better way than this
if (page.get('id') === page.get('relativeId')) {
window.location.reload();
return; return;
} }