Skip to content

Commit

Permalink
fix(wrapper): fire platformLoaded event later
Browse files Browse the repository at this point in the history
  • Loading branch information
rxri committed Aug 27, 2024
1 parent af872ea commit 18aea02
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions jsHelper/spicetifyWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ window.Spicetify = {
Spicetify.Platform[key] = _platform[key];
}
}

if (!Spicetify.Platform.Registry) Spicetify.Events.platformLoaded.fire();
})();

(function addMissingPlatformAPIs() {
Expand All @@ -344,8 +342,6 @@ window.Spicetify = {
Spicetify.Platform[symbolName] = resolvedAPI;
console.debug(`[spicetifyWrapper] Resolved PlatformAPI from Registry: ${symbolName}`);
}

if (Spicetify.Events.platformLoaded.callbacks.length) Spicetify.Events.platformLoaded.fire();
})();

(async function addProxyCosmos() {
Expand Down Expand Up @@ -491,6 +487,9 @@ window.Spicetify = {
console.log("[spicetifyWrapper] All required webpack modules loaded");
chunks = Object.entries(require.m);
cache = Object.keys(require.m).map((id) => require(id));

// Fire platformLoaded event there because of the sleep functions before
Spicetify.Events.platformLoaded.fire();
});

const modules = cache
Expand Down

0 comments on commit 18aea02

Please sign in to comment.