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:
parent
d499888cfd
commit
7428199fdd
1 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue