mirror of
https://github.com/Vendicated/Vencord
synced 2024-09-13 04:29:24 -04:00
Fetch styles async
Co-authored-by: vee <vendicated@riseup.net>
This commit is contained in:
parent
5ac7ed6b18
commit
a3bbe21e92
1 changed files with 2 additions and 3 deletions
|
@ -9,9 +9,8 @@
|
|||
export async function getStyles(): Promise<string> {
|
||||
let out = "";
|
||||
const styleLinkNodes: NodeListOf<HTMLLinkElement> = document.querySelectorAll('link[rel="stylesheet"]');
|
||||
for (const styleLinkNode of styleLinkNodes)
|
||||
out += await parseStyleLinkNode(styleLinkNode);
|
||||
return out;
|
||||
return Promise.all(styleLinkNodes.map(n => parseStyleLinkNode(n)))
|
||||
.then(contents => contents.join("\n"));
|
||||
}
|
||||
|
||||
// runs callback with styles of new style nodes added to the head
|
||||
|
|
Loading…
Reference in a new issue