Skip to content

Commit 0f7b1c4

Browse files
rename action
1 parent f6868e0 commit 0f7b1c4

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

editor/core/actions/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type Action =
3131
| EditorModeAction
3232
| DesignerModeSwitchActon
3333
| SelectNodeAction
34-
| LocateNodeAction
34+
| CanvasFocusNodeAction
3535
| HighlightNodeAction
3636
| CanvasEditAction
3737
| CanvasModeAction
@@ -78,8 +78,8 @@ export interface SelectNodeAction {
7878
/**
7979
* Select and move to the node.
8080
*/
81-
export interface LocateNodeAction {
82-
type: "locate-node";
81+
export interface CanvasFocusNodeAction {
82+
type: "canvas/focus";
8383
node: string;
8484
}
8585

editor/core/reducers/editor-reducer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type {
1414
BackgroundTaskPopAction,
1515
BackgroundTaskUpdateProgressAction,
1616
EditorModeSwitchAction,
17-
LocateNodeAction,
17+
CanvasFocusNodeAction,
1818
DesignerModeSwitchActon,
1919
CodingInitialFilesSeedAction,
2020
CodingNewTemplateSessionAction,
@@ -105,8 +105,8 @@ export function editorReducer(state: EditorState, action: Action): EditorState {
105105
return reducers["select-node"](state, action);
106106
}
107107

108-
case "locate-node": {
109-
const { node } = <LocateNodeAction>action;
108+
case "canvas/focus": {
109+
const { node } = <CanvasFocusNodeAction>action;
110110

111111
update_route(router, { node });
112112

editor/scaffolds/editor-home/editor-home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function EditorHomePageView() {
7171
}}
7272
onDoubleClick={() => {
7373
dispatch({
74-
type: "locate-node",
74+
type: "canvas/focus",
7575
node: s.id,
7676
});
7777
dispatch({
@@ -101,7 +101,7 @@ export function EditorHomePageView() {
101101
}}
102102
onDoubleClick={() => {
103103
dispatch({
104-
type: "locate-node",
104+
type: "canvas/focus",
105105
node: cmp.id,
106106
});
107107
dispatch({

0 commit comments

Comments
 (0)