@@ -21,7 +21,7 @@ import type {
2121 EnterIsolatedInspectionAction ,
2222 ExitIsolatedInspectionAction ,
2323} from "core/actions" ;
24- import { EditorState } from "core/states" ;
24+ import { EditorState , EssentialWorkspaceInfo } from "core/states" ;
2525import { NextRouter , useRouter } from "next/router" ;
2626import { CanvasStateStore } from "@code-editor/canvas/stores" ;
2727import q from "@design-sdk/query" ;
@@ -31,8 +31,6 @@ import { nanoid } from "nanoid";
3131import { last_page_by_mode } from "core/stores" ;
3232import { track } from "@code-editor/analytics" ;
3333
34- const _editor_path_name = "/files/[key]/" ;
35-
3634const _DEV_CLEAR_LOG = false ;
3735
3836const clearlog = ( by : string ) => {
@@ -42,7 +40,10 @@ const clearlog = (by: string) => {
4240 }
4341} ;
4442
45- export function editorReducer ( state : EditorState , action : Action ) : EditorState {
43+ export function editorReducer (
44+ state : EditorState & EssentialWorkspaceInfo ,
45+ action : Action
46+ ) : EditorState {
4647 const router = useRouter ( ) ;
4748 const filekey = state . design . key ;
4849
@@ -395,10 +396,8 @@ function update_route(
395396
396397 // remove undefined fields
397398 Object . keys ( q ) . forEach ( ( k ) => q [ k ] === undefined && delete q [ k ] ) ;
398-
399399 router . push (
400400 {
401- pathname : _editor_path_name ,
402401 query : { ...router . query , ...q } ,
403402 } ,
404403 undefined ,
0 commit comments