From 782d0098768fe44df3203e0ecde288707b93dc25 Mon Sep 17 00:00:00 2001 From: dpilafian Date: Sat, 19 Aug 2023 14:35:18 -0700 Subject: [PATCH] Fix missing icons when dna is not loaded --- src/js/lib-x.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/lib-x.ts b/src/js/lib-x.ts index a813aa0..ece5855 100644 --- a/src/js/lib-x.ts +++ b/src/js/lib-x.ts @@ -4,6 +4,7 @@ // MIT License // ////////////////////////////////////////// +// Types export type GlobalKey = keyof typeof globalThis; export type Json = string | number | boolean | null | undefined | JsonObject | Json[]; export type JsonObject = { [key: string]: Json }; @@ -1026,12 +1027,14 @@ const libX = { globalThis.libX = libX; const initializeDna = () => { const dna = globalThis['dna']; - dna.registerInitializer(libX.ui.normalize); - dna.registerInitializer(libX.ui.makeIcons); + dna.registerInitializer(libX.ui.normalize, { onDomReady: false }); + dna.registerInitializer(libX.ui.makeIcons, { onDomReady: false }); }; + if ('dna' in globalThis) + initializeDna(); const onReadySetup = () => { - if ('dna' in globalThis) - initializeDna(); + libX.ui.normalize(); + libX.ui.makeIcons(); libX.ui.setupForkMe(); libX.ui.displayAddr(); libX.ui.setupVideos();