mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 02:02:19 +00:00
fix(tasks): don't send delta around as an array (#13967)
Co-authored-by: SabreCat <sabe@habitica.com>
This commit is contained in:
parent
a1a3022392
commit
a0de2dab49
2 changed files with 2 additions and 2 deletions
|
|
@ -362,5 +362,5 @@ export default function scoreTask (options = {}, req = {}, analytics) {
|
|||
checkOnboardingStatus(user, req, analytics);
|
||||
}
|
||||
|
||||
return [delta];
|
||||
return delta;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ async function scoreTask (user, task, direction, req, res) {
|
|||
const wasCompleted = task.completed;
|
||||
|
||||
const firstTask = !user.achievements.completedTask;
|
||||
const [delta] = shared.ops.scoreTask({ task, user, direction }, req, res.analytics);
|
||||
const delta = shared.ops.scoreTask({ task, user, direction }, req, res.analytics);
|
||||
// Drop system (don't run on the client,
|
||||
// as it would only be discarded since ops are sent to the API, not the results)
|
||||
if (direction === 'up' && !firstTask) shared.fns.randomDrop(user, { task, delta }, req, res.analytics);
|
||||
|
|
|
|||
Loading…
Reference in a new issue