mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Added extra confirmation incase the class modal shows multiple times (#9557)
This commit is contained in:
@@ -154,6 +154,7 @@ export default {
|
||||
this.$root.$emit('bv::hide::modal', 'choose-class');
|
||||
},
|
||||
clickSelectClass (heroClass) {
|
||||
if (this.user.flags.classSelected && !confirm(this.$t('changeClassConfirmCost'))) return;
|
||||
this.$store.dispatch('user:changeClass', {query: {class: heroClass}});
|
||||
},
|
||||
clickDisableClasses () {
|
||||
|
||||
@@ -81,6 +81,8 @@ export async function changeClass (store, params) {
|
||||
const user = store.state.user.data;
|
||||
|
||||
changeClassOp(user, params);
|
||||
user.flags.classSelected = true;
|
||||
|
||||
let response = await axios.post(`/api/v3/user/change-class?class=${params.query.class}`);
|
||||
return response.data.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user