mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
Enabled repeatables (#8572)
* Enabled repeatables * Added every x to weekly * Updated new recur logic to work with tests * Added repeatable tests back * Added custom day start support * Moved back to zone function * Added zone back * Added nextDue field * Abstracted set next due logic, set offset, and mapped to ISO * Removed extra codes * Removed clone deep * Added summary local * Fixed every x weekly * Prevented edit of repeats on * Added next due date * Fixed display of next due dates * Fixed broken tests * added next due date as today for weekly * Fixed integration tests * Updated common test * Use user's format * Allow user to deselect all days during week * Removed let from front end
This commit is contained in:
committed by
Sabe Jones
parent
ba66a1c098
commit
cc532fa993
@@ -17,6 +17,7 @@ import {
|
||||
createTasks,
|
||||
getTasks,
|
||||
moveTask,
|
||||
setNextDue,
|
||||
} from '../../libs/taskManager';
|
||||
import common from '../../../common';
|
||||
import Bluebird from 'bluebird';
|
||||
@@ -456,9 +457,7 @@ api.updateTask = {
|
||||
task.group.approval.required = true;
|
||||
}
|
||||
|
||||
if (sanitizedObj.type === 'daily') {
|
||||
task.isDue = common.shouldDo(Date.now(), sanitizedObj, user.preferences);
|
||||
}
|
||||
setNextDue(task, user);
|
||||
|
||||
let savedTask = await task.save();
|
||||
|
||||
@@ -589,6 +588,8 @@ api.scoreTask = {
|
||||
}
|
||||
}
|
||||
|
||||
setNextDue(task, user);
|
||||
|
||||
if (user._ABtests && user._ABtests.guildReminder && user._ABtests.counter !== -1) {
|
||||
user._ABtests.counter++;
|
||||
if (user._ABtests.counter > 1) {
|
||||
@@ -601,10 +602,6 @@ api.scoreTask = {
|
||||
user.markModified('_ABtests');
|
||||
}
|
||||
|
||||
if (task.type === 'daily') {
|
||||
task.isDue = common.shouldDo(Date.now(), task, user.preferences);
|
||||
}
|
||||
|
||||
let results = await Bluebird.all([
|
||||
user.save(),
|
||||
task.save(),
|
||||
|
||||
Reference in New Issue
Block a user