mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-12 23:08:35 +00:00
fix(fix): hide future mystery sets in Time Travel shop
...not in the gear tree
This commit is contained in:
parent
cdb058b696
commit
b3e3d0cb63
2 changed files with 7 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ const FIRST_MYSTERY_SET = moment('2014-02-01');
|
|||
|
||||
for (
|
||||
let mysteryMonth = FIRST_MYSTERY_SET;
|
||||
moment(mysteryMonth).startOf('month').isSameOrBefore(moment());
|
||||
moment(mysteryMonth).startOf('month').isSameOrBefore(moment().add(1, 'months'));
|
||||
mysteryMonth = moment(mysteryMonth).add(1, 'months')
|
||||
) {
|
||||
const setKey = moment(mysteryMonth).format('YYYYMM');
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import filter from 'lodash/filter';
|
|||
import keys from 'lodash/keys';
|
||||
import union from 'lodash/union';
|
||||
import reduce from 'lodash/reduce';
|
||||
import moment from 'moment';
|
||||
|
||||
import mysterySets from './mystery-sets';
|
||||
import gear from './gear';
|
||||
|
|
@ -24,7 +25,11 @@ const timeTravelerStore = user => {
|
|||
ownedKeys = keys(typeof owned.toObject === 'function' ? owned.toObject() : owned);
|
||||
ownedKeys = union(ownedKeys, unopenedGifts);
|
||||
return reduce(mystery, (m, v, k) => {
|
||||
if (k === 'wondercon' || ownedKeys.indexOf(v.items[0].key) !== -1) {
|
||||
if (
|
||||
k === 'wondercon'
|
||||
|| ownedKeys.indexOf(v.items[0].key) !== -1
|
||||
|| (moment(k).isAfter() && moment(k).isBefore('3000-01-01'))
|
||||
) {
|
||||
return m;
|
||||
}
|
||||
m[k] = v;
|
||||
|
|
|
|||
Loading…
Reference in a new issue