mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Cleanup pinned items that are no longer for purchase
This commit is contained in:
@@ -7,6 +7,7 @@ import common from '../../common';
|
||||
import { preenUserHistory } from './preening';
|
||||
import { sleep } from './sleep';
|
||||
import { revealMysteryItems } from './payments/subscriptions';
|
||||
import cleanupPinnedItems from '../../common/script/libs/cleanupPinnedItems';
|
||||
|
||||
const CRON_SAFE_MODE = nconf.get('CRON_SAFE_MODE') === 'true';
|
||||
const CRON_SEMI_SAFE_MODE = nconf.get('CRON_SEMI_SAFE_MODE') === 'true';
|
||||
@@ -499,6 +500,10 @@ export async function cron (options = {}) {
|
||||
_.merge(progress, { down: 0, up: 0, collectedItems: 0 });
|
||||
}
|
||||
|
||||
if (user.pinnedItems && user.pinnedItems.length > 0) {
|
||||
user.pinnedItems = cleanupPinnedItems(user);
|
||||
}
|
||||
|
||||
// Send notification for changes in HP and MP.
|
||||
// First remove a possible previous cron notification because
|
||||
// we don't want to flood the users with many cron notifications at once.
|
||||
|
||||
Reference in New Issue
Block a user