Skip to content

Commit

Permalink
Fix missing icons when dna is not loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Aug 19, 2023
1 parent 0c5714d commit 782d009
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/js/lib-x.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -1026,12 +1027,14 @@ const libX = {
globalThis.libX = libX;
const initializeDna = () => {
const dna = globalThis[<GlobalKey>'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();
Expand Down

0 comments on commit 782d009

Please sign in to comment.