Skip to content

Commit 04e60f2

Browse files
committed
fix(app): no flash of home page on start
1 parent 23d71e1 commit 04e60f2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

packages/app/src/pages/layout.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ export default function Layout(props: ParentProps) {
120120
})
121121
const editorRef = { current: undefined as HTMLInputElement | undefined }
122122

123+
const autoselecting = createMemo(() => {
124+
if (params.dir) return false
125+
if (initialDir) return false
126+
if (!autoselect()) return false
127+
if (!pageReady()) return true
128+
if (!layoutReady()) return true
129+
const list = layout.projects.list()
130+
if (list.length === 0) return false
131+
return true
132+
})
133+
123134
const editorOpen = (id: string) => editor.active === id
124135
const editorValue = () => editor.value
125136

@@ -2194,7 +2205,9 @@ export default function Layout(props: ParentProps) {
21942205
"xl:border-l xl:rounded-tl-sm": !layout.sidebar.opened(),
21952206
}}
21962207
>
2197-
{props.children}
2208+
<Show when={!autoselecting()} fallback={<div class="size-full" />}>
2209+
{props.children}
2210+
</Show>
21982211
</main>
21992212
</div>
22002213
<Toast.Region />

0 commit comments

Comments
 (0)