From b709b7a31bb39f0a177f3d021ad39a800e879b16 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 1 Apr 2021 10:53:55 +0200 Subject: [PATCH] Fix OO error modal in switch to read-only --- www/common/onlyoffice/inner.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 6962d0a73..6c2d9332f 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1375,12 +1375,11 @@ define([ return; } - if (lock) { - getEditor().setViewModeDisconnect(); - } else if (readOnly) { + if (lock || readOnly) { try { getEditor().asc_setRestriction(true); } catch (e) {} + //getEditor().setViewModeDisconnect(); // can't be used anymore, display an OO error popup } else { setEditable(true); deleteOfflineLocks(); @@ -1400,7 +1399,6 @@ define([ } } - if (isLockedModal.modal && force) { isLockedModal.modal.closeModal(); delete isLockedModal.modal; @@ -1424,7 +1422,7 @@ define([ } catch (e) {} } - if (APP.migrate && !readOnly) { + if (lock && !readOnly) { onMigrateRdy.fire(); }