mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix errors
This commit is contained in:
@@ -358,6 +358,7 @@ export default {
|
|||||||
|
|
||||||
return response;
|
return response;
|
||||||
}, error => { // Set up Error interceptors
|
}, error => { // Set up Error interceptors
|
||||||
|
console.log(error);
|
||||||
if (error.response.status >= 400) {
|
if (error.response.status >= 400) {
|
||||||
const isBanned = this.checkForBannedUser(error);
|
const isBanned = this.checkForBannedUser(error);
|
||||||
if (isBanned === true) return null; // eslint-disable-line consistent-return
|
if (isBanned === true) return null; // eslint-disable-line consistent-return
|
||||||
|
|||||||
@@ -291,7 +291,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="ENABLE_TIME_TRAVEL && user.permissions.fullAccess"
|
v-if="ENABLE_TIME_TRAVEL && user.permissions && user.permissions.fullAccess"
|
||||||
:key="lastTimeJump"
|
:key="lastTimeJump"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
|
import axios from 'axios';
|
||||||
import BootstrapVue from 'bootstrap-vue';
|
import BootstrapVue from 'bootstrap-vue';
|
||||||
import Fragment from 'vue-fragment';
|
import Fragment from 'vue-fragment';
|
||||||
import AppComponent from './app';
|
import AppComponent from './app';
|
||||||
@@ -38,13 +39,14 @@ const store = getStore();
|
|||||||
if (process.env.ENABLE_TIME_TRAVEL) {
|
if (process.env.ENABLE_TIME_TRAVEL) {
|
||||||
(async () => {
|
(async () => {
|
||||||
const sinon = await import('sinon');
|
const sinon = await import('sinon');
|
||||||
const axios = await import('axios');
|
if (axios.defaults.headers.common['x-api-user']) {
|
||||||
const response = await axios.get('/api/v4/debug/time-travel-time');
|
const response = await axios.get('/api/v4/debug/time-travel-time');
|
||||||
const time = new Date(response.data.data.time);
|
const time = new Date(response.data.data.time);
|
||||||
Vue.config.clock = sinon.useFakeTimers({
|
Vue.config.clock = sinon.useFakeTimers({
|
||||||
now: time,
|
now: time,
|
||||||
shouldAdvanceTime: true,
|
shouldAdvanceTime: true,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ envVars
|
|||||||
envObject[`process.env.${key}`] = `'${nconf.get(key)}'`;
|
envObject[`process.env.${key}`] = `'${nconf.get(key)}'`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(envObject)
|
||||||
|
|
||||||
const webpackPlugins = [
|
const webpackPlugins = [
|
||||||
new webpack.DefinePlugin(envObject),
|
new webpack.DefinePlugin(envObject),
|
||||||
new webpack.ContextReplacementPlugin(/moment[\\/]locale$/, /^\.\/(NOT_EXISTING)$/),
|
new webpack.ContextReplacementPlugin(/moment[\\/]locale$/, /^\.\/(NOT_EXISTING)$/),
|
||||||
@@ -56,6 +58,11 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
resolve: {
|
||||||
|
fallback: {
|
||||||
|
"timers": require.resolve("timers-browserify")
|
||||||
|
},
|
||||||
|
},
|
||||||
plugins: webpackPlugins,
|
plugins: webpackPlugins,
|
||||||
},
|
},
|
||||||
chainWebpack: config => {
|
chainWebpack: config => {
|
||||||
|
|||||||
@@ -799,6 +799,7 @@ export function assembleScheduledMatchers (date) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let cachedScheduleMatchers = null;
|
let cachedScheduleMatchers = null;
|
||||||
|
let cacheDate = null;
|
||||||
|
|
||||||
function makeMatcherClass () {
|
function makeMatcherClass () {
|
||||||
return {
|
return {
|
||||||
@@ -832,10 +833,10 @@ export function getScheduleMatchingGroup (type, date) {
|
|||||||
}
|
}
|
||||||
if (!cachedScheduleMatchers) {
|
if (!cachedScheduleMatchers) {
|
||||||
cacheDate = new Date();
|
cacheDate = new Date();
|
||||||
const scheduleMatchers = {};
|
cachedScheduleMatchers = {};
|
||||||
assembleScheduledMatchers(checkedDate).forEach(matcher => {
|
assembleScheduledMatchers(checkedDate).forEach(matcher => {
|
||||||
if (!scheduleMatchers[matcher.type]) {
|
if (!cachedScheduleMatchers[matcher.type]) {
|
||||||
scheduleMatchers[matcher.type] = makeMatcherClass();
|
cachedScheduleMatchers[matcher.type] = makeMatcherClass();
|
||||||
}
|
}
|
||||||
if (matcher.matcher instanceof Function) {
|
if (matcher.matcher instanceof Function) {
|
||||||
cachedScheduleMatchers[matcher.type].matchers.push(matcher.matcher);
|
cachedScheduleMatchers[matcher.type].matchers.push(matcher.matcher);
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ shops.getQuestShopCategories = function getQuestShopCategories (user, language)
|
|||||||
};
|
};
|
||||||
|
|
||||||
bundleCategory.items = sortBy(values(content.bundles)
|
bundleCategory.items = sortBy(values(content.bundles)
|
||||||
.filter(bundle => bundle.type === 'quests' && bundle.canBuy())
|
.filter(bundle => bundle.type === 'quests')
|
||||||
.map(bundle => getItemInfo(user, 'bundles', bundle, officialPinnedItems, language)));
|
.map(bundle => getItemInfo(user, 'bundles', bundle, officialPinnedItems, language)));
|
||||||
|
|
||||||
if (bundleCategory.items.length > 0) {
|
if (bundleCategory.items.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user