Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Commit 5da948d

Browse files
committed
何もかも表示されない問題修正
1 parent f16abda commit 5da948d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

workspaces/client/src/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const main = async () => {
1212
await registerServiceWorker();
1313
// await preloadImages();
1414

15-
document.addEventListener('DOMContentLoaded', () => {
15+
const fn = () => {
1616
if (window.location.pathname.startsWith('/admin')) {
1717
ReactDOM.createRoot(document.getElementById('root')!).render(<AdminApp />);
1818
} else {
@@ -25,7 +25,13 @@ const main = async () => {
2525
</SWRConfig>,
2626
);
2727
}
28-
});
28+
};
29+
30+
if (document.readyState !== 'loading') {
31+
fn();
32+
} else {
33+
document.addEventListener('DOMContentLoaded', fn);
34+
}
2935
};
3036

3137
main().catch(console.error);

0 commit comments

Comments
 (0)