mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 18:06:22 +00:00
add back code that got lost
This commit is contained in:
parent
09a497493b
commit
e6b9720b64
1 changed files with 3 additions and 0 deletions
|
@ -338,6 +338,9 @@ export function waitFor(filter: string | string[] | FilterFn, callback: Callback
|
||||||
else if (typeof filter !== "function")
|
else if (typeof filter !== "function")
|
||||||
throw new Error("filter must be a string, string[] or function, got " + typeof filter);
|
throw new Error("filter must be a string, string[] or function, got " + typeof filter);
|
||||||
|
|
||||||
|
const [existing, id] = find(filter!, { isIndirect: true, isWaitFor: true });
|
||||||
|
if (existing) return void callback(existing, id);
|
||||||
|
|
||||||
subscriptions.set(filter, callback);
|
subscriptions.set(filter, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue