Skip to content

Commit 3aad24c

Browse files
authored
Fix the legacy support in editor.navigate (#1513)
1 parent a303b1b commit 3aad24c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

web/syscalls/editor.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ export function editorSyscalls(client: Client): SysCallMapping {
107107
ref = parsedRef;
108108
}
109109

110-
// @ts-ignore: Legacy support
111-
if (ref.kind === "page" || ref.kind === "document") {
110+
if (
111+
// @ts-ignore: Legacy support
112+
ref.page !== undefined
113+
) {
112114
console.warn(
113115
"You are using legacy navigation syntax with `editor.navigate()`, this will be phased out in the future",
114116
);
@@ -121,6 +123,8 @@ export function editorSyscalls(client: Client): SysCallMapping {
121123
meta?: boolean;
122124
};
123125

126+
legacyRef.kind ??= "page";
127+
124128
let details: Ref["details"] = undefined;
125129

126130
if (typeof legacyRef.pos === "number") {

0 commit comments

Comments
 (0)