dbusServices/extensions: Check earlier for existing dialog

There is no point in making a D-Bus call if we are going to bail
out anyway.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
This commit is contained in:
Florian Müllner 2023-07-10 00:00:04 +02:00 committed by Marge Bot
parent 3451c5a182
commit b4c2901e47

View File

@ -114,11 +114,10 @@ export const ExtensionsService = class extends ServiceImplementation {
const [uuid, parentWindow, options] = params;
try {
const [serialized] = await this._proxy.GetExtensionInfoAsync(uuid);
if (this._prefsDialog)
throw new Error('Already showing a prefs dialog');
const [serialized] = await this._proxy.GetExtensionInfoAsync(uuid);
const extension = ExtensionUtils.deserializeExtension(serialized);
this._prefsDialog = new ExtensionPrefsDialog(extension);