light-style: Always save scheme preference on enable()

Disable() should restore the scheme preference that was used when
the extension was enabled, not when it was first initialized.

Even if it's unlikely to be relevant in practice, let's make sure
we save the correct state.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/257>
This commit is contained in:
Florian Müllner
2023-07-02 23:24:33 +02:00
parent b7895ad956
commit b11f0f16f4
+1 -4
View File
@@ -21,16 +21,13 @@ const {St} = imports.gi;
const Main = imports.ui.main;
class Extension {
constructor() {
this._savedColorScheme = Main.sessionMode.colorScheme;
}
_updateColorScheme(scheme) {
Main.sessionMode.colorScheme = scheme;
St.Settings.get().notify('color-scheme');
}
enable() {
this._savedColorScheme = Main.sessionMode.colorScheme;
this._updateColorScheme('prefer-light');
}