Fix improved locks

pull/1/head
yflory 4 years ago
parent ae985cef20
commit 3496862ed9

@ -989,7 +989,12 @@ define([
deleteOfflineLocks(); deleteOfflineLocks();
// Prepare callback // Prepare callback
if (cpNfInner) { if (cpNfInner) {
APP.waitLock = Util.mkEvent(true); var waitLock = APP.waitLock = Util.mkEvent(true);
setTimeout(function () {
// Make sure the waitLock is never stuck
waitLock.fire();
if (waitLock === APP.waitLock) { delete APP.waitLock; }
}, 5000);
var onPatchSent = function (again) { var onPatchSent = function (again) {
if (!again) { cpNfInner.offPatchSent(onPatchSent); } if (!again) { cpNfInner.offPatchSent(onPatchSent); }
// Answer to our onlyoffice // Answer to our onlyoffice
@ -1005,8 +1010,8 @@ define([
type: "getLock", type: "getLock",
locks: getLock() locks: getLock()
}); });
APP.waitLock.fire(); waitLock.fire();
delete APP.waitLock; if (waitLock === APP.waitLock) { delete APP.waitLock; }
} else { } else {
if (!isLockedModal.modal) { if (!isLockedModal.modal) {
isLockedModal.modal = UI.openCustomModal(isLockedModal.content); isLockedModal.modal = UI.openCustomModal(isLockedModal.content);

Loading…
Cancel
Save