Skip to content

Commit

Permalink
fix: prevent user from navigating away from setup plugins page while …
Browse files Browse the repository at this point in the history
…installing
  • Loading branch information
squigglybob committed Jan 7, 2025
1 parent fce268c commit 649ca74
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions dt-core/admin/components/setup-wizard-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ export class SetupWizardPlugins extends OpenLitElement {
}

back() {
this.dispatchEvent(new CustomEvent('back'));
if (this.canNavigate()) {
this.dispatchEvent(new CustomEvent('back'));
}
}
skip() {
this.dispatchEvent(new CustomEvent('next'));
}
async next() {
const plugins_to_install = this.getPluginsToInstall();
console.log(this.finished, plugins_to_install);
if (this.finished || plugins_to_install.length === 0) {
if (this.canNavigate()) {
this.dispatchEvent(new CustomEvent('next'));
return;
}
Expand Down Expand Up @@ -86,12 +87,14 @@ export class SetupWizardPlugins extends OpenLitElement {
this.requestUpdate();
}
nextLabel() {
const plugins_to_install = this.getPluginsToInstall();
if (this.finished || plugins_to_install.length === 0) {
if (this.canNavigate()) {
return 'Next';
}
return 'Confirm';
}
canNavigate() {
return this.finished || this.getPluginsToInstall().length === 0;
}
setToastMessage(message) {
this.toastMessage = message;
}
Expand Down

0 comments on commit 649ca74

Please sign in to comment.