Skip to content

Commit 18aea02

Browse files
committed
fix(wrapper): fire platformLoaded event later
1 parent af872ea commit 18aea02

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

jsHelper/spicetifyWrapper.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ window.Spicetify = {
319319
Spicetify.Platform[key] = _platform[key];
320320
}
321321
}
322-
323-
if (!Spicetify.Platform.Registry) Spicetify.Events.platformLoaded.fire();
324322
})();
325323

326324
(function addMissingPlatformAPIs() {
@@ -344,8 +342,6 @@ window.Spicetify = {
344342
Spicetify.Platform[symbolName] = resolvedAPI;
345343
console.debug(`[spicetifyWrapper] Resolved PlatformAPI from Registry: ${symbolName}`);
346344
}
347-
348-
if (Spicetify.Events.platformLoaded.callbacks.length) Spicetify.Events.platformLoaded.fire();
349345
})();
350346

351347
(async function addProxyCosmos() {
@@ -491,6 +487,9 @@ window.Spicetify = {
491487
console.log("[spicetifyWrapper] All required webpack modules loaded");
492488
chunks = Object.entries(require.m);
493489
cache = Object.keys(require.m).map((id) => require(id));
490+
491+
// Fire platformLoaded event there because of the sleep functions before
492+
Spicetify.Events.platformLoaded.fire();
494493
});
495494

496495
const modules = cache

0 commit comments

Comments
 (0)