mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-19 04:08:53 +00:00
throw an error if the ready event is not fired after 50 tries
This commit is contained in:
parent
0ecd8d6166
commit
fa29a12d00
1 changed files with 2 additions and 0 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue