mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix #12498: do not score task when using a skill
This commit is contained in:
@@ -16,7 +16,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
async beforeTaskScore (task) {
|
async beforeTaskScore (task) {
|
||||||
const { user } = this;
|
const { user } = this;
|
||||||
if (this.castingSpell) return;
|
if (this.castingSpell) return false;
|
||||||
|
|
||||||
if (task.group.approval.required && !task.group.approval.approved) {
|
if (task.group.approval.required && !task.group.approval.approved) {
|
||||||
task.group.approval.requested = true;
|
task.group.approval.requested = true;
|
||||||
@@ -30,6 +30,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
playTaskScoreSound (task, direction) {
|
playTaskScoreSound (task, direction) {
|
||||||
switch (task.type) { // eslint-disable-line default-case
|
switch (task.type) { // eslint-disable-line default-case
|
||||||
@@ -50,7 +52,8 @@ export default {
|
|||||||
async taskScore (task, direction) {
|
async taskScore (task, direction) {
|
||||||
const { user } = this;
|
const { user } = this;
|
||||||
|
|
||||||
await this.beforeTaskScore(task);
|
const canScoreTask = await this.beforeTaskScore(task);
|
||||||
|
if (!canScoreTask) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
scoreTask({ task, user, direction });
|
scoreTask({ task, user, direction });
|
||||||
|
|||||||
Reference in New Issue
Block a user