Better lock message

pull/1/head
yflory 5 years ago
parent 7bb59b518f
commit e1119290df

@ -458,6 +458,7 @@ define([
setTimeout(function () { setTimeout(function () {
Notifier.notify(); Notifier.notify();
}); });
return frame;
}; };
UI.alert = function (msg, cb, opt) { UI.alert = function (msg, cb, opt) {

@ -531,6 +531,9 @@ define([
delete content.locks[id]; delete content.locks[id];
} }
}); });
if (content.saveLock && !isUserOnline(content.saveLock)) {
delete content.saveLock;
}
}; };
var handleAuth = function (obj, send) { var handleAuth = function (obj, send) {
@ -595,9 +598,16 @@ define([
}; };
// Add a lock // Add a lock
var isLockedModal = {
content: UI.customModal(h('div', [
h('span.fa.fa-spin.fa-spinner'),
"pewpewpew"
]))
var handleLock = function (obj, send) { var handleLock = function (obj, send) {
if (content.saveLock) { if (content.saveLock) {
if (Messages.oo_isLocked) { UI.log(Messages.oo_isLocked); } if (!isLockedModal.modal) {
isLockedModal.modal = UI.openCustomModal(isLockedModal.content);
}
setTimeout(function () { setTimeout(function () {
handleLock(obj, send); handleLock(obj, send);
}, 50); }, 50);
@ -621,12 +631,18 @@ define([
if (!again) { cpNfInner.offPatchSent(onPatchSent); } if (!again) { cpNfInner.offPatchSent(onPatchSent); }
// Answer to our onlyoffice // Answer to our onlyoffice
if (!content.saveLock) { if (!content.saveLock) {
if (isLockedModal.modal) {
isLockedModal.modal.closeModal();
delete isLockedModal.modal();
}
send({ send({
type: "getLock", type: "getLock",
locks: getLock() locks: getLock()
}); });
} else { } else {
if (Messages.oo_isLocked) { UI.log(Messages.oo_isLocked); } if (!isLockedModal.modal) {
isLockedModal.modal = UI.openCustomModal(isLockedModal.content);
}
setTimeout(function () { setTimeout(function () {
onPatchSent(true); onPatchSent(true);
}, 50); }, 50);

Loading…
Cancel
Save