mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-26 07:46:31 +01:00
more upgrade flow fixes
This commit is contained in:
@@ -429,6 +429,8 @@ export default class SafeUpgrade {
|
||||
this.pollTimer = null;
|
||||
let nextStage = null;
|
||||
|
||||
let shouldContinue = true;
|
||||
|
||||
this.statusRequest = request(this.urls.status, (response) => {
|
||||
if (response.status === 'error') {
|
||||
if (!silent) {
|
||||
@@ -445,6 +447,10 @@ export default class SafeUpgrade {
|
||||
const data = response.data || {};
|
||||
nextStage = data.stage || null;
|
||||
this.renderProgress(data);
|
||||
|
||||
if (nextStage === 'installing' || nextStage === 'finalizing' || nextStage === 'complete') {
|
||||
shouldContinue = false;
|
||||
}
|
||||
});
|
||||
|
||||
const finalize = () => {
|
||||
@@ -456,8 +462,10 @@ export default class SafeUpgrade {
|
||||
|
||||
if (nextStage === 'complete' || nextStage === 'error') {
|
||||
this.stopPolling();
|
||||
} else {
|
||||
} else if (shouldContinue) {
|
||||
this.schedulePoll();
|
||||
} else {
|
||||
this.stopPolling();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user