extensionSystem: Allow changing extensions in ERROR state

While an extension's actual state can no longer change once it is
in ERROR state, its requested state can. In fact, disabling an
erroneous extension is highly recommended, so that it doesn't cause
problems again on the next login.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7004

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3073>
This commit is contained in:
Florian Müllner 2023-12-20 00:02:35 +01:00 committed by Marge Bot
parent 02b19e3b5c
commit f9e81284f8

View File

@ -370,7 +370,6 @@ export class ExtensionManager extends Signals.EventEmitter {
extension.errors.push(message);
logError(error, `Extension ${uuid}`);
this._updateCanChange(extension);
this.emit('extension-state-changed', extension);
}
@ -572,10 +571,6 @@ export class ExtensionManager extends Signals.EventEmitter {
}
_updateCanChange(extension) {
let hasError =
extension.state === ExtensionState.ERROR ||
extension.state === ExtensionState.OUT_OF_DATE;
let isMode = this._getModeExtensions().includes(extension.uuid);
let modeOnly = global.settings.get_boolean(DISABLE_USER_EXTENSIONS_KEY);
@ -584,7 +579,6 @@ export class ExtensionManager extends Signals.EventEmitter {
: ENABLED_EXTENSIONS_KEY;
extension.canChange =
!hasError &&
global.settings.is_writable(changeKey) &&
(isMode || !modeOnly);
}