mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-15 00:12:17 +00:00
bug fix on saving chal
This commit is contained in:
parent
63b4e5152e
commit
7161ddf70e
1 changed files with 2 additions and 2 deletions
|
|
@ -47,7 +47,7 @@ ChallengeSchema.methods.toJSON = function(){
|
|||
// --------------
|
||||
|
||||
function syncableAttrs(task) {
|
||||
var t = task.toObject(); // lodash doesn't seem to like _.omit on EmbeddedDocument
|
||||
var t = (task.toObject) ? task.toObject() : task; // lodash doesn't seem to like _.omit on EmbeddedDocument
|
||||
// only sync/compare important attrs
|
||||
var omitAttrs = 'history tags completed streak'.split(' ');
|
||||
if (t.type != 'reward') omitAttrs.push('value');
|
||||
|
|
@ -67,7 +67,7 @@ function comparableData(obj) {
|
|||
.toString(); // for comparing arrays easily
|
||||
}
|
||||
|
||||
ChallengeSchema.isOutdated = function(newData) {
|
||||
ChallengeSchema.methods.isOutdated = function(newData) {
|
||||
return comparableData(this) !== comparableData(newData);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue