throw an error if the ready event is not fired after 50 tries

This commit is contained in:
Send_Nukez 2021-12-18 22:59:12 +01:00
parent 0ecd8d6166
commit fa29a12d00

View file

@ -38,7 +38,9 @@ export default class Dribbblish {
this.loader = new Loader();
this.icons = icons;
let tries = 0;
const interval = setInterval(() => {
if (++tries > 50) throw new Error("ready timeout");
if (document.querySelector("#main") == null || Spicetify?.showNotification == undefined || !this.info.isReady()) return;
this.#ready = true;
this.emit("ready");