Browse Source

Fix;

feature/tasks
stingl 4 years ago
parent
commit
6dd5978496
  1. 15
      js/app.js

15
js/app.js

@ -358,12 +358,7 @@ const TimeTrack = {
color: 'blue', color: 'blue',
buttons: [ buttons: [
['<button><i class="fas fa-undo"></i></button>', function (instance, toast) { ['<button><i class="fas fa-undo"></i></button>', function (instance, toast) {
let restoredTracker = null; component.restoreTrashed();
Object.assign(restoredTracker, component.trashed);
component.trashed = {};
component.tickets.push(restoredTracker);
component.updateStorage();
}, true] }, true]
], ],
timeout: 12000 timeout: 12000
@ -371,6 +366,14 @@ const TimeTrack = {
this.updateStorage(); this.updateStorage();
}, },
restoreTrashed() {
let restoredTracker = {};
Object.assign(restoredTracker, this.trashed);
this.trashed = {};
this.tickets.push(restoredTracker);
this.updateStorage();
},
archiveTracker(index) { archiveTracker(index) {
if (this.tickets[index].tracking) { if (this.tickets[index].tracking) {
this.stopActiveTracker(); this.stopActiveTracker();