[MainWindow] ThemeSync: Only save userDataCache if value changed, tweak interval value for saving
This commit is contained in:
parent
705febfb11
commit
85349da075
1 changed files with 3 additions and 3 deletions
|
@ -5,12 +5,12 @@ const update = async () => {
|
||||||
let cached = await DiscordNative.userDataCache.getCached() || {};
|
let cached = await DiscordNative.userDataCache.getCached() || {};
|
||||||
|
|
||||||
const value = `.theme-dark { ${vars.reduce((acc, x) => acc += `${x}: ${getVar(x)}; `, '')} }`;
|
const value = `.theme-dark { ${vars.reduce((acc, x) => acc += `${x}: ${getVar(x)}; `, '')} }`;
|
||||||
|
const pastValue = cached['openasarSplashCSS'];
|
||||||
cached['openasarSplashCSS'] = value;
|
cached['openasarSplashCSS'] = value;
|
||||||
|
|
||||||
DiscordNative.userDataCache.cacheUserData(JSON.stringify(cached));
|
if (value !== pastValue) DiscordNative.userDataCache.cacheUserData(JSON.stringify(cached));
|
||||||
};
|
};
|
||||||
setInterval(update, 5000);
|
setInterval(update, 3000);
|
||||||
|
|
||||||
const css = `
|
const css = `
|
||||||
.socialLinks-3jqNFy + .info-1VyQPT .colorMuted-HdFt4q:nth-last-child(2)::after {
|
.socialLinks-3jqNFy + .info-1VyQPT .colorMuted-HdFt4q:nth-last-child(2)::after {
|
||||||
|
|
Loading…
Reference in a new issue