mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-09 14:43:03 -04:00
Reimplement Discord's Switch to fix performance (#413)
This commit is contained in:
parent
e49151ff33
commit
1d287357ca
5 changed files with 161 additions and 57 deletions
|
@ -49,9 +49,11 @@ if (location.protocol !== "data:") {
|
|||
const css = readFileSync(rendererCss, "utf-8");
|
||||
insertCss(css);
|
||||
if (IS_DEV) {
|
||||
watch(rendererCss, debounce(() => {
|
||||
// persistent means keep process running if watcher is the only thing still running
|
||||
// which we obviously don't want
|
||||
watch(rendererCss, { persistent: false }, () => {
|
||||
document.getElementById("vencord-css-core")!.textContent = readFileSync(rendererCss, "utf-8");
|
||||
}, 30));
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
if ((err as NodeJS.ErrnoException)?.code !== "ENOENT")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue