refactored collab controller

This commit is contained in:
nikita_bartoshuk
2026-03-24 23:27:11 +03:00
parent 6dde8fd5e6
commit 03185bd415

View File

@ -43,9 +43,10 @@ class CollaborationController extends Component {
}
} else if (!appOptions.isEdit && appOptions.isRestrictedEdit) {
isFastCoauth = true;
api.asc_SetFastCollaborative(LocalStorage.itemExists(`${window.editorType}-mobile-autosave`) ? LocalStorage.getBool(`${window.editorType}-mobile-autosave`) : true);
const isAutosaveInLs = LocalStorage.itemExists(`${window.editorType}-mobile-autosave`);
api.asc_SetFastCollaborative(isAutosaveInLs ? LocalStorage.getBool(`${window.editorType}-mobile-autosave`) : true);
window.editorType === 'de' && api.SetCollaborativeMarksShowType(Asc.c_oAscCollaborativeMarksShowType.None);
api.asc_setAutoSaveGap(LocalStorage.itemExists(`${window.editorType}-mobile-autosave`) ? parseInt(LocalStorage.getItem(`${window.editorType}-mobile-autosave`)) : 1);
api.asc_setAutoSaveGap(isAutosaveInLs ? parseInt(LocalStorage.getItem(`${window.editorType}-mobile-autosave`)) : 1);
} else if (appOptions.canLiveView) { // viewer
isFastCoauth = !(appOptions.config.coEditing && appOptions.config.coEditing.mode==='strict');
api.asc_SetFastCollaborative(isFastCoauth);
@ -65,8 +66,9 @@ class CollaborationController extends Component {
value = isFastCoauth; // Common.localStorage.getItem("de-settings-autosave");
value = (!isFastCoauth && value !== null) ? parseInt(value) : (appOptions.canCoAuthoring ? 1 : 0);
}
api.asc_SetFastCollaborative(value ? (LocalStorage.itemExists(`${window.editorType}-mobile-autosave`) ? LocalStorage.getBool(`${window.editorType}-mobile-autosave`) : true) : false);
api.asc_setAutoSaveGap(value ? (LocalStorage.itemExists(`${window.editorType}-mobile-autosave`) ? parseInt(LocalStorage.getItem(`${window.editorType}-mobile-autosave`)) : 1) : 0);
const isAutosaveInLs = LocalStorage.itemExists(`${window.editorType}-mobile-autosave`);
api.asc_SetFastCollaborative(value ? (isAutosaveInLs ? LocalStorage.getBool(`${window.editorType}-mobile-autosave`) : true) : false);
api.asc_setAutoSaveGap(value ? (isAutosaveInLs ? parseInt(LocalStorage.getItem(`${window.editorType}-mobile-autosave`)) : 1) : 0);
}
/** coauthoring end **/
}