Fixed issue that would force a page reload when failing to install/update a plugin or theme.

# Conflicts:
#	CHANGELOG.md
#	themes/grav/js/admin.min.js
#	themes/grav/js/vendor.min.js
This commit is contained in:
Djamil Legato
2020-09-03 21:26:47 -07:00
parent c7fe6be9de
commit b13d3aa2df
4 changed files with 195 additions and 191 deletions

View File

@@ -3,6 +3,7 @@
1. [](#bugfix)
* More multi-site routing fixes
* Fixed issue that would force a page reload when failing to install/update a plugin or theme.
# v1.10.0-rc.16
## 09/01/2020

View File

@@ -280,12 +280,16 @@ class Packages {
let url = Packages.getInstallPackageUrl(type);
Promise.all(slugs.map((slug) => {
return request(url, {
method: 'post',
body: {
package: slug,
type: type
}
return new Promise((resolve, reject) => {
request(url, {
method: 'post',
body: {
package: slug,
type: type
}
}, (response) => {
resolve(response);
});
});
})).then(callbackSuccess);
@@ -409,8 +413,10 @@ class Packages {
$('[data-packages-modal] .installing-package').addClass('hidden');
$('[data-packages-modal] .installation-complete').removeClass('hidden');
if (response.status === 'error') {
let remodal = $.remodal.lookup[$('[data-packages-modal]').data('remodal')];
const errors = Array.from(response).filter((r) => r.status === 'error');
if (errors && errors.length) {
let remodal = $.remodal.lookup[$('[data-packages-modal].remodal-is-opened').data('remodal')];
remodal.close();
return;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long