mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57:22 +01:00
proof of concept for time travel
This commit is contained in:
committed by
Sabe Jones
parent
127f105934
commit
1b12e9d8b7
@@ -1,4 +1,5 @@
|
||||
import Vue from 'vue';
|
||||
import sinon from 'sinon';
|
||||
import BootstrapVue from 'bootstrap-vue';
|
||||
import Fragment from 'vue-fragment';
|
||||
import AppComponent from './app';
|
||||
@@ -13,6 +14,7 @@ import './filters/registerGlobals';
|
||||
import i18n from './libs/i18n';
|
||||
import 'smartbanner.js/dist/smartbanner';
|
||||
|
||||
let jumped = false;
|
||||
const IS_PRODUCTION = process.env.NODE_ENV === 'production'; // eslint-disable-line no-process-env
|
||||
|
||||
// Configure Vue global options, see https://vuejs.org/v2/api/#Global-Config
|
||||
@@ -35,6 +37,21 @@ setUpLogging();
|
||||
setupAnalytics(); // just create queues for analytics, no scripts loaded at this time
|
||||
const store = getStore();
|
||||
|
||||
const time = new Date(2024, 2, 18);
|
||||
const clock = sinon.useFakeTimers({
|
||||
now: time,
|
||||
shouldAdvanceTime: true,
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
if (jumped) {
|
||||
jumped = false;
|
||||
return;
|
||||
}
|
||||
jumped = true;
|
||||
clock.jump(36000);
|
||||
}, 1000);
|
||||
|
||||
const vueInstance = new Vue({
|
||||
el: '#app',
|
||||
router,
|
||||
|
||||
Reference in New Issue
Block a user