mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-18 10:57:04 -04:00
Fix plugins broken by latest Discord update (#3237)
This commit is contained in:
parent
3e524f9d92
commit
b5ef858e71
12 changed files with 98 additions and 37 deletions
|
@ -20,9 +20,9 @@ export function makeLazy<T>(factory: () => T, attempts = 5): () => T {
|
|||
let tries = 0;
|
||||
let cache: T;
|
||||
return () => {
|
||||
if (!cache && attempts > tries++) {
|
||||
if (cache === undefined && attempts > tries++) {
|
||||
cache = factory();
|
||||
if (!cache && attempts === tries)
|
||||
if (cache === undefined && attempts === tries)
|
||||
console.error("Lazy factory failed:", factory);
|
||||
}
|
||||
return cache;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue