Skip to content

Commit

Permalink
Add check at the start of profile handling functions to prevent multi…
Browse files Browse the repository at this point in the history
…ple attempts at the same time
  • Loading branch information
VilppeRiskidev committed Nov 10, 2024
1 parent 7934ac4 commit 971b048
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/profiles-modals/CreateProfileModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export default class CreateProfileModal extends ProfilesMixin {
// User confirmed creation of a new profile with a name that didn't exist before.
async createProfile() {
if (this.creatingInProgress) {
return;
}
const safeName = this.makeProfileNameSafe(this.newProfileName);
if (safeName !== '') {
try {
Expand Down
3 changes: 3 additions & 0 deletions src/components/profiles-modals/DeleteProfileModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export default class DeleteProfileModal extends ProfilesMixin {
}
async removeProfile() {
if (this.deletingInProgress) {
return;
}
try {
this.deletingInProgress = true;
await this.$store.dispatch('profiles/removeSelectedProfile');
Expand Down
3 changes: 3 additions & 0 deletions src/components/profiles-modals/RenameProfileModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export default class RenameProfileModal extends ProfilesMixin {
}
async performRename() {
if (this.renamingInProgress) {
return;
}
try {
this.renamingInProgress = true;
await this.$store.dispatch('profiles/renameProfile', {newName: this.newProfileName});
Expand Down

0 comments on commit 971b048

Please sign in to comment.