[DE mobile] Fix Bug 63278

This commit is contained in:
SergeyEzhin
2023-07-10 09:54:15 +03:00
parent 8e7a723358
commit be69a26e48
5 changed files with 14 additions and 11 deletions

View File

@ -795,7 +795,7 @@ class MainController extends Component {
const { t } = this.props;
const storeAppOptions = this.props.storeAppOptions;
const props = this.getDocProps(true);
const isProtected = props && (props.isReadOnly || props.isCommentsOnly || props.isFormsOnly || props.isReviewOnly);
const isProtected = props && (props.isReadOnly || props.isCommentsOnly || props.isFormsOnly || props.isReviewOnly || props.isTrackedChanges);
let textWarningDialog;
if(!storeAppOptions.isReviewOnly) {
@ -822,6 +822,7 @@ class MainController extends Component {
}
storeAppOptions.setProtection(isProtected);
storeAppOptions.setTypeProtection(props.type);
props && this.applyRestrictions(props.type);
Common.Notifications.trigger('protect:doclock', props);
@ -852,7 +853,8 @@ class MainController extends Component {
storeAppOptions.canComments && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
storeAppOptions.canFillForms && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms);
} else {
this.api.asc_setRestriction(Asc.c_oAscRestrictionType.None);
// this.api.asc_setRestriction(Asc.c_oAscRestrictionType.None);
this.api.asc_setRestriction(Asc.c_oAscRestrictionType.View);
}
}
};
@ -871,7 +873,8 @@ class MainController extends Component {
isReadOnly: type === Asc.c_oAscEDocProtect.ReadOnly,
isCommentsOnly: type === Asc.c_oAscEDocProtect.Comments,
isReviewOnly: type === Asc.c_oAscEDocProtect.TrackedChanges,
isFormsOnly: type === Asc.c_oAscEDocProtect.Forms
isFormsOnly: type === Asc.c_oAscEDocProtect.Forms,
isTrackedChanges: type === Asc.c_oAscEDocProtect.TrackedChanges
};
}

View File

@ -191,7 +191,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
f7.popover.close('.document-menu.modal-in', false);
appOptions.changeViewerMode();
appOptions.changeViewerMode(true);
api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
}

View File

@ -27,9 +27,10 @@ class ProtectionDocumentController extends React.Component {
appOptions.setProtection(true);
appOptions.setTypeProtection(typeProtection);
if(typeProtection !== Asc.c_oAscEDocProtect.TrackedChanges && !isViewer) {
appOptions.changeViewerMode();
}
// if(typeProtection !== Asc.c_oAscEDocProtect.TrackedChanges && !isViewer) {
appOptions.changeViewerMode(true);
api.asc_addRestriction(Asc.c_oAscRestrictionType.View);
// }
protection.asc_setEditType(typeProtection);
protection.asc_setPassword(password);

View File

@ -116,7 +116,7 @@ class MainPage extends Component {
f7.popover.close('.document-menu.modal-in', false);
f7.navbar.show('.main-navbar', false);
appOptions.changeViewerMode();
appOptions.changeViewerMode(false);
api.asc_removeRestriction(Asc.c_oAscRestrictionType.View)
api.asc_addRestriction(Asc.c_oAscRestrictionType.None);
};

View File

@ -64,10 +64,9 @@ export class storeAppOptions {
this.isMobileView = !this.isMobileView;
}
isViewer = true;
changeViewerMode() {
this.isViewer = !this.isViewer;
changeViewerMode(value) {
this.isViewer = value;
}
canViewComments = false;