(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
This commit is contained in:
Alex Hall 2022-02-03 17:08:25 +02:00
parent fa9e6eee88
commit 22006754af
2 changed files with 4 additions and 4 deletions

View File

@ -350,7 +350,7 @@ export class GristDoc extends DisposableWithEvents {
dom.domComputed<IDocPage>(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)))
)),
);

View File

@ -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);
}