mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
add option to reset TT
This commit is contained in:
@@ -308,6 +308,10 @@
|
|||||||
>-30 Days</a>
|
>-30 Days</a>
|
||||||
<div class="my-2">
|
<div class="my-2">
|
||||||
Time Traveling! It is {{ new Date().toLocaleDateString() }}
|
Time Traveling! It is {{ new Date().toLocaleDateString() }}
|
||||||
|
<a
|
||||||
|
class="btn btn-warning mr-1"
|
||||||
|
@click="resetTime()"
|
||||||
|
>Reset</a>
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
class="btn btn-secondary mr-1"
|
class="btn btn-secondary mr-1"
|
||||||
@@ -916,6 +920,17 @@ export default {
|
|||||||
this.lastTimeJump = response.data.data.time;
|
this.lastTimeJump = response.data.data.time;
|
||||||
this.triggerGetWorldState(true);
|
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 () {
|
addExp () {
|
||||||
// @TODO: Name these variables better
|
// @TODO: Name these variables better
|
||||||
let exp = 0;
|
let exp = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user