diff --git a/app/client/components/GristDoc.ts b/app/client/components/GristDoc.ts index 053e90b1..4adda671 100644 --- a/app/client/components/GristDoc.ts +++ b/app/client/components/GristDoc.ts @@ -153,7 +153,9 @@ export class GristDoc extends DisposableWithEvents { const defaultViewId = this.docInfo.newDefaultViewId; // Grainjs observable for current view id, which may be a string such as 'code'. - this.activeViewId = Computed.create(this, urlState().state, (use, s) => s.docPage || defaultViewId.peek()); + this.activeViewId = Computed.create(this, (use) => { + return use(urlState().state).docPage || use(defaultViewId); + }); // This viewModel reflects the currently active view, relying on the fact that // createFloatingRowModel() supports an observable rowId for its argument.