mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix(quests): correct events import, prod bug with seasonal availability
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import find from 'lodash/find';
|
import find from 'lodash/find';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import EVENTS from 'events';
|
import { EVENTS } from './events';
|
||||||
import t from '../translation';
|
import t from '../translation';
|
||||||
|
|
||||||
const CURRENT_EVENT = find(
|
const CURRENT_EVENT = find(
|
||||||
@@ -33,6 +33,9 @@ const QUEST_SEASONAL = {
|
|||||||
gp: 20,
|
gp: 20,
|
||||||
exp: 100,
|
exp: 100,
|
||||||
},
|
},
|
||||||
|
canBuy () {
|
||||||
|
return this.event && moment().isBetween(this.event.start, this.event.end);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
evilsanta2: {
|
evilsanta2: {
|
||||||
event: CURRENT_EVENT && CURRENT_EVENT.season === 'winter' ? CURRENT_EVENT : null,
|
event: CURRENT_EVENT && CURRENT_EVENT.season === 'winter' ? CURRENT_EVENT : null,
|
||||||
@@ -63,6 +66,9 @@ const QUEST_SEASONAL = {
|
|||||||
gp: 20,
|
gp: 20,
|
||||||
exp: 100,
|
exp: 100,
|
||||||
},
|
},
|
||||||
|
canBuy () {
|
||||||
|
return this.event && moment().isBetween(this.event.start, this.event.end);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// spring
|
// spring
|
||||||
egg: {
|
egg: {
|
||||||
@@ -125,6 +131,9 @@ const QUEST_SEASONAL = {
|
|||||||
gp: 0,
|
gp: 0,
|
||||||
exp: 0,
|
exp: 0,
|
||||||
},
|
},
|
||||||
|
canBuy () {
|
||||||
|
return this.event && moment().isBetween(this.event.start, this.event.end);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
waffle: {
|
waffle: {
|
||||||
text: t('questWaffleText'),
|
text: t('questWaffleText'),
|
||||||
@@ -165,6 +174,9 @@ const QUEST_SEASONAL = {
|
|||||||
exp: 500,
|
exp: 500,
|
||||||
unlock: t('questWaffleUnlockText'),
|
unlock: t('questWaffleUnlockText'),
|
||||||
},
|
},
|
||||||
|
canBuy () {
|
||||||
|
return this.event && moment().isBetween(this.event.start, this.event.end);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user