mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
chore: Remove temporary code
This commit is contained in:
@@ -392,17 +392,6 @@ api.scoreTask = {
|
||||
|
||||
let wasCompleted = task.completed;
|
||||
|
||||
// TEMPORARY, remove once collection migration completes
|
||||
if (typeof user.party.quest.progress.collect === 'object') {
|
||||
let totalItemsFound = _.reduce(user.party.quest.progress.collect, (total, amount) => {
|
||||
return total + amount;
|
||||
}, 0);
|
||||
|
||||
user.party.quest.progress.collect = totalItemsFound;
|
||||
} else if (!user.party.quest.progress.collect) {
|
||||
user.party.quest.progress.collect = 0;
|
||||
}
|
||||
|
||||
let [delta] = common.ops.scoreTask({task, user, direction}, req);
|
||||
// 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') user.fns.randomDrop({task, delta}, req);
|
||||
|
||||
@@ -587,17 +587,6 @@ schema.statics.processQuestProgress = async function processQuestProgress (user,
|
||||
|
||||
if (!_isOnQuest(user, progress, group)) return;
|
||||
|
||||
// TEMPORARY, remove once collection migration completes
|
||||
if (typeof progress.collect === 'object') {
|
||||
let totalItemsFound = _.reduce(progress.collect, (total, amount) => {
|
||||
return total + amount;
|
||||
}, 0);
|
||||
|
||||
progress.collect = totalItemsFound;
|
||||
} else if (!progress.collect) {
|
||||
progress.collect = 0;
|
||||
}
|
||||
|
||||
let quest = shared.content.quests[group.quest.key];
|
||||
|
||||
if (!quest) return; // TODO should this throw an error instead?
|
||||
|
||||
@@ -376,8 +376,7 @@ export let schema = new Schema({
|
||||
progress: {
|
||||
up: {type: Number, default: 0},
|
||||
down: {type: Number, default: 0},
|
||||
// TEMPORARY - Switch type to Number after migration
|
||||
collect: {type: Schema.Types.Mixed, default: 0},
|
||||
collect: {type: Number, default: 0},
|
||||
},
|
||||
completed: String, // When quest is done, we move it from key => completed, and it's a one-time flag (for modal) that they unset by clicking "ok" in browser
|
||||
RSVPNeeded: {type: Boolean, default: false}, // Set to true when invite is pending, set to false when quest invite is accepted or rejected, quest starts, or quest is cancelled
|
||||
|
||||
Reference in New Issue
Block a user