mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Tasks score notes (#8507)
* Added setting and modal for score notes * Added persistent score notes * Fixed linting issues and documented new field * Added max length to task score notes * Added check for score notes existence * Combined tasks perferences
This commit is contained in:
@@ -210,11 +210,15 @@ module.exports = function scoreTask (options = {}, req = {}) {
|
||||
_gainMP(user, _.max([0.25, 0.0025 * user._statsComputed.maxMP]) * (direction === 'down' ? -1 : 1));
|
||||
|
||||
task.history = task.history || [];
|
||||
|
||||
// Add history entry, even more than 1 per day
|
||||
task.history.push({
|
||||
let historyEntry = {
|
||||
date: Number(new Date()),
|
||||
value: task.value,
|
||||
});
|
||||
};
|
||||
if (task.scoreNotes) historyEntry.scoreNotes = task.scoreNotes;
|
||||
|
||||
task.history.push(historyEntry);
|
||||
|
||||
_updateCounter(task, direction, times);
|
||||
} else if (task.type === 'daily') {
|
||||
|
||||
Reference in New Issue
Block a user