Skip to content

Commit 980cf9f

Browse files
fix devtime router query warning issue
1 parent 96acdcb commit 980cf9f

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

editor/core/reducers/editor-reducer.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ export function editorReducer(state: EditorState, action: Action): EditorState {
1616
console.info("cleard console by editorReducer#select-node");
1717

1818
// update router
19-
router.query.node = node ?? state.selectedPage;
20-
router.push(router);
19+
router.push(
20+
{
21+
pathname: router.pathname,
22+
query: { ...router.query, node: node ?? state.selectedPage },
23+
},
24+
undefined,
25+
{}
26+
);
2127

2228
return produce(state, (draft) => {
2329
const _canvas_state_store = new CanvasStateStore(
@@ -42,8 +48,14 @@ export function editorReducer(state: EditorState, action: Action): EditorState {
4248
console.info("cleard console by editorReducer#select-page");
4349

4450
// update router
45-
router.query.node = page;
46-
router.push(router);
51+
router.push(
52+
{
53+
pathname: router.pathname,
54+
query: { ...router.query, node: page },
55+
},
56+
undefined,
57+
{}
58+
);
4759

4860
return produce(state, (draft) => {
4961
const _canvas_state_store = new CanvasStateStore(filekey, page);

0 commit comments

Comments
 (0)