(core) Skip saving layout resizes in read-only mode

Summary:
This change causes a notification about missing
write access to no longer be shown when resizing layouts
as a viewer.

Test Plan: Browser test.

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D3167
pull/115/head
George Gevoian 3 years ago
parent ef1fc916e6
commit 7f08934cf0

@ -106,7 +106,11 @@ export class ViewLayout extends DisposableWithEvents implements IDomComponent {
this._isResizing.set(false);
layoutSaveDelay.schedule(1000, () => {
if (!this._layout) { return; }
(this.viewModel.layoutSpecObj as any).setAndSave(this._layout.getLayoutSpec());
// Only save layout changes when the document isn't read-only.
if (!this.gristDoc.isReadonly.get()) {
(this.viewModel.layoutSpecObj as any).setAndSave(this._layout.getLayoutSpec());
}
this._onResize();
});
});

Loading…
Cancel
Save