mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
remove all changes from eslint --fix
This commit is contained in:
@@ -3,29 +3,29 @@ import i18n from '../i18n';
|
||||
import _ from 'lodash';
|
||||
import splitWhitespace from '../libs/splitWhitespace';
|
||||
|
||||
module.exports = function (user, req, cb, analytics) {
|
||||
module.exports = function(user, req, cb, analytics) {
|
||||
var analyticsData, key, ref, type;
|
||||
ref = req.params, type = ref.type, key = ref.key;
|
||||
if (!content.timeTravelStable[type]) {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 403,
|
||||
message: i18n.t('typeNotAllowedHourglass', req.language) + JSON.stringify(_.keys(content.timeTravelStable))
|
||||
}) : void 0;
|
||||
}
|
||||
if (!_.contains(_.keys(content.timeTravelStable[type]), key)) {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 403,
|
||||
message: i18n.t(type + 'NotAllowedHourglass', req.language)
|
||||
}) : void 0;
|
||||
}
|
||||
if (user.items[type][key]) {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 403,
|
||||
message: i18n.t(type + 'AlreadyOwned', req.language)
|
||||
}) : void 0;
|
||||
}
|
||||
if (!(user.purchased.plan.consecutive.trinkets > 0)) {
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 403,
|
||||
message: i18n.t('notEnoughHourglasses', req.language)
|
||||
}) : void 0;
|
||||
@@ -44,10 +44,10 @@ module.exports = function (user, req, cb, analytics) {
|
||||
acquireMethod: 'Hourglass',
|
||||
category: 'behavior'
|
||||
};
|
||||
if (analytics) {
|
||||
if (analytics != null) {
|
||||
analytics.track('acquire item', analyticsData);
|
||||
}
|
||||
return typeof cb === 'function' ? cb({
|
||||
return typeof cb === "function" ? cb({
|
||||
code: 200,
|
||||
message: i18n.t('hourglassPurchase', req.language)
|
||||
}, _.pick(user, splitWhitespace('items purchased.plan.consecutive'))) : void 0;
|
||||
|
||||
Reference in New Issue
Block a user