mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 06:03:03 -04:00
rewrite settings api to use SettingsStore class (#2257)
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
parent
7190437e92
commit
9aa205b5ec
16 changed files with 336 additions and 180 deletions
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { addSettingsListener, Settings } from "@api/Settings";
|
||||
import { Settings, SettingsStore } from "@api/Settings";
|
||||
|
||||
|
||||
let style: HTMLStyleElement;
|
||||
|
@ -81,10 +81,10 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
initThemes();
|
||||
|
||||
toggle(Settings.useQuickCss);
|
||||
addSettingsListener("useQuickCss", toggle);
|
||||
SettingsStore.addChangeListener("useQuickCss", toggle);
|
||||
|
||||
addSettingsListener("themeLinks", initThemes);
|
||||
addSettingsListener("enabledThemes", initThemes);
|
||||
SettingsStore.addChangeListener("themeLinks", initThemes);
|
||||
SettingsStore.addChangeListener("enabledThemes", initThemes);
|
||||
|
||||
if (!IS_WEB)
|
||||
VencordNative.quickCss.addThemeChangeListener(initThemes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue