From 22006754af374bcd3c103fa8e3a13fdeea4534fd Mon Sep 17 00:00:00 2001 From: Alex Hall Date: Thu, 3 Feb 2022 17:08:25 +0200 Subject: [PATCH] (core) Remove 'new' from IDocPage Summary: The value seems unused Test Plan: This is me testing if it's actually unused Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D3244 --- app/client/components/GristDoc.ts | 2 +- app/common/gristUrls.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/client/components/GristDoc.ts b/app/client/components/GristDoc.ts index c56b8768..a1d0d7b4 100644 --- a/app/client/components/GristDoc.ts +++ b/app/client/components/GristDoc.ts @@ -350,7 +350,7 @@ export class GristDoc extends DisposableWithEvents { dom.domComputed(this.activeViewId, (viewId) => ( viewId === 'code' ? dom.create((owner) => owner.autoDispose(CodeEditorPanel.create(this))) : viewId === 'acl' ? dom.create((owner) => owner.autoDispose(AccessRules.create(this, this))) : - viewId === 'new' || viewId == 'GristDocTour' ? null : + viewId === 'GristDocTour' ? null : dom.create((owner) => (this._viewLayout = ViewLayout.create(owner, this, viewId))) )), ); diff --git a/app/common/gristUrls.ts b/app/common/gristUrls.ts index 70421d04..ff37d856 100644 --- a/app/common/gristUrls.ts +++ b/app/common/gristUrls.ts @@ -10,7 +10,7 @@ import {Document} from 'app/common/UserAPI'; import clone = require('lodash/clone'); import pickBy = require('lodash/pickBy'); -export type IDocPage = number | 'new' | 'code' | 'acl' | 'GristDocTour'; +export type IDocPage = number | 'code' | 'acl' | 'GristDocTour'; // What page to show in the user's home area. Defaults to 'workspace' if a workspace is set, and // to 'all' otherwise. @@ -356,8 +356,8 @@ export function userOverrideParams(email: string|null, extraState?: IGristUrlSta * parseDocPage is a noop if p is 'new' or 'code', otherwise parse to integer */ function parseDocPage(p: string) { - if (['new', 'code', 'acl', 'GristDocTour'].includes(p)) { - return p as 'new'|'code'|'acl'|'GristDocTour'; + if (['code', 'acl', 'GristDocTour'].includes(p)) { + return p as 'code'|'acl'|'GristDocTour'; } return parseInt(p, 10); }