extensionDownloader: Remove pending updates with extension

When an extension is uninstalled, there is no point in keeping
a pending update: If the update didn't fail (which it currently
does), we would end up sneakily reinstalling the extension.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2343
This commit is contained in:
Florian Müllner 2020-03-09 16:49:34 +01:00 committed by Georges Basile Stavracas Neto
parent b97fc02e57
commit d3939a38a3

View File

@ -56,6 +56,15 @@ function uninstallExtension(uuid) {
return false;
FileUtils.recursivelyDeleteDir(extension.dir, true);
try {
const updatesDir = Gio.File.new_for_path(GLib.build_filenamev(
[global.userdatadir, 'extension-updates', extension.uuid]));
FileUtils.recursivelyDeleteDir(updatesDir, true);
} catch (e) {
// not an error
}
return true;
}