Revert "Revert "allow hatching potions to have a release date""

This reverts commit 485584c144.

# Conflicts:
#	website/common/script/content/hatching-potions.js
This commit is contained in:
Phillip Thelen
2024-06-11 18:54:39 +02:00
parent 6c5bff7843
commit a00f199d18
9 changed files with 101 additions and 109 deletions

View File

@@ -2,9 +2,6 @@ import defaults from 'lodash/defaults';
import each from 'lodash/each';
import { assign } from 'lodash';
import t from './translation';
import datedMemoize from '../fns/datedMemoize';
import { filterReleased } from './is_released';
import { HATCHING_POTIONS_RELEASE_DATES } from './constants/release_dates';
function hasQuestAchievementFunction (key) {
return user => user.achievements.quests && user.achievements.quests[key] > 0;
@@ -196,23 +193,8 @@ each(wacky, (pot, key) => {
});
});
function filterEggs (eggs) {
return filterReleased(eggs, 'key', HATCHING_POTIONS_RELEASE_DATES);
}
const all = assign({}, drops, premium, wacky);
const memoizedFilter = datedMemoize(filterEggs);
export default {
get drops () {
return memoizedFilter({ memoizeConfig: true, identifier: 'drops' }, drops);
},
get premium () {
return memoizedFilter({ memoizeConfig: true, identifier: 'premium' }, premium);
},
get wacky () {
return memoizedFilter({ memoizeConfig: true, identifier: 'wacky' }, wacky);
},
get all () {
return assign({}, this.drops, this.premium, this.wacky);
},
export {
drops, premium, wacky, all,
};