diff --git a/src/hooks/useEditor.ts b/src/hooks/useEditor.ts index 3a8d141..afc3d1a 100644 --- a/src/hooks/useEditor.ts +++ b/src/hooks/useEditor.ts @@ -238,6 +238,7 @@ export const useEditor = create((set, get) => ({ path: "main.js", }); + get().editor?.setScrollTop(0); get().update(); get().run(); }, @@ -247,6 +248,8 @@ export const useEditor = create((set, get) => ({ }); useProject.persist.rehydrate(); + + get().editor?.setScrollTop(0); get().update(); get().run(); },