Fix OnlyOffice issues when reconnecting

pull/1/head
yflory 4 years ago
parent 76ba55acbe
commit 49f9d872f4

@ -2668,16 +2668,22 @@ define([
} }
// Only execute the following code the first time we call onReady
if (!firstReady) {
setMyId();
oldHashes = JSON.parse(JSON.stringify(content.hashes));
initializing = false;
return void setEditable(!readOnly);
}
firstReady = false;
var useNewDefault = content.version && content.version >= 2; var useNewDefault = content.version && content.version >= 2;
openRtChannel(function () { openRtChannel(function () {
setMyId(); setMyId();
oldHashes = JSON.parse(JSON.stringify(content.hashes)); oldHashes = JSON.parse(JSON.stringify(content.hashes));
initializing = false; initializing = false;
// Only execute the following code the first time we call onReady
if (!firstReady) { return void setEditable(!readOnly); }
firstReady = false;
common.openPadChat(APP.onLocal); common.openPadChat(APP.onLocal);
if (!readOnly) { if (!readOnly) {
@ -2836,10 +2842,12 @@ define([
common.gotoURL(); common.gotoURL();
}); });
} }
setEditable(true); //setEditable(true);
try { getEditor().asc_setViewMode(false); } catch (e) {}
offline = false; offline = false;
} else { } else {
setEditable(false); try { getEditor().asc_setViewMode(true); } catch (e) {}
//setEditable(false);
offline = true; offline = true;
UI.findOKButton().click(); UI.findOKButton().click();
UIElements.disconnectAlert(); UIElements.disconnectAlert();

Loading…
Cancel
Save