Skip to content

Commit 3854910

Browse files
committed
only download dsfr after hydratation
1 parent 13db1e5 commit 3854910

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/start.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,20 @@ export async function start(params: Params) {
3939
registerEffectAction
4040
});
4141

42-
(window as any).dsfr = { verbose, "mode": "manual" };
42+
console.log("registering action download dsfr and start", Date.now());
4343

44-
console.log("Start download DSFR js", Date.now());
44+
registerEffectAction(async () => {
45+
console.log("executing action download dsfr and start", Date.now());
4546

46-
await import("./dsfr/dsfr.module" as any);
47+
(window as any).dsfr = { verbose, "mode": "manual" };
4748

48-
console.log("DSFR js downloaded", Date.now());
49+
console.log("Start download DSFR js", Date.now());
4950

50-
const { dsfr } = window as unknown as { dsfr: { start: () => void } };
51+
await import("./dsfr/dsfr.module" as any);
5152

52-
console.log("registering action dsfr.start", Date.now());
53+
console.log("DSFR js downloaded", Date.now());
5354

54-
registerEffectAction(() => {
55-
console.log("executing action dsfr.start", Date.now());
55+
const { dsfr } = window as unknown as { dsfr: { start: () => void } };
5656

5757
dsfr.start();
5858
});

0 commit comments

Comments
 (0)