(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
This commit is contained in:
George Gevoian 2021-12-05 13:43:47 -08:00
parent ef1fc916e6
commit 7f08934cf0

View File

@ -106,7 +106,11 @@ export class ViewLayout extends DisposableWithEvents implements IDomComponent {
this._isResizing.set(false); this._isResizing.set(false);
layoutSaveDelay.schedule(1000, () => { layoutSaveDelay.schedule(1000, () => {
if (!this._layout) { return; } if (!this._layout) { return; }
// 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.viewModel.layoutSpecObj as any).setAndSave(this._layout.getLayoutSpec());
}
this._onResize(); this._onResize();
}); });
}); });