add option to reset TT

This commit is contained in:
Phillip Thelen
2024-04-24 16:38:10 +02:00
parent daa296f2af
commit 4bbdf27f48

View File

@@ -308,6 +308,10 @@
>-30 Days</a>
<div class="my-2">
Time Traveling! It is {{ new Date().toLocaleDateString() }}
<a
class="btn btn-warning mr-1"
@click="resetTime()"
>Reset</a>
</div>
<a
class="btn btn-secondary mr-1"
@@ -916,6 +920,17 @@ export default {
this.lastTimeJump = response.data.data.time;
this.triggerGetWorldState(true);
},
async resetTime () {
const response = await axios.post('/api/v4/debug/jump-time', { reset: true });
const time = new Date(response.data.data.time);
Vue.config.clock.restore();
Vue.config.clock = sinon.useFakeTimers({
now: time,
shouldAdvanceTime: true,
});
this.lastTimeJump = response.data.data.time;
this.triggerGetWorldState(true);
},
addExp () {
// @TODO: Name these variables better
let exp = 0;