diff --git a/src/Terminal/commands/ls.tsx b/src/Terminal/commands/ls.tsx index 202882605..b94faa997 100644 --- a/src/Terminal/commands/ls.tsx +++ b/src/Terminal/commands/ls.tsx @@ -136,8 +136,9 @@ export function ls(args: (string | number | boolean)[], server: BaseServer): voi function onClick() { const code = server.scripts.get(fullPath)?.content ?? ""; const files = new Map(); + const options = { hostname: server.hostname }; files.set(fullPath, code); - Router.toPage(Page.ScriptEditor, { files }); + Router.toPage(Page.ScriptEditor, { files, options }); } return ( diff --git a/src/ui/GameRoot.tsx b/src/ui/GameRoot.tsx index 4066512db..1d690b70c 100644 --- a/src/ui/GameRoot.tsx +++ b/src/ui/GameRoot.tsx @@ -246,7 +246,7 @@ export function GameRoot(): React.ReactElement { mainPage = ( ); diff --git a/src/ui/Router.ts b/src/ui/Router.ts index a6a6524cb..83d052afb 100644 --- a/src/ui/Router.ts +++ b/src/ui/Router.ts @@ -88,7 +88,8 @@ export type PageWithContext = | { page: SimplePage }; export interface ScriptEditorRouteOptions { - vim: boolean; + vim?: boolean; + hostname?: string; } /** The router keeps track of player navigation/routing within the game. */