diff --git a/js/app.js b/js/app.js index b7bdf3e..9adbeec 100644 --- a/js/app.js +++ b/js/app.js @@ -358,12 +358,7 @@ const TimeTrack = { color: 'blue', buttons: [ ['', function (instance, toast) { - let restoredTracker = null; - Object.assign(restoredTracker, component.trashed); - component.trashed = {}; - - component.tickets.push(restoredTracker); - component.updateStorage(); + component.restoreTrashed(); }, true] ], timeout: 12000 @@ -371,6 +366,14 @@ const TimeTrack = { this.updateStorage(); }, + restoreTrashed() { + let restoredTracker = {}; + Object.assign(restoredTracker, this.trashed); + this.trashed = {}; + + this.tickets.push(restoredTracker); + this.updateStorage(); + }, archiveTracker(index) { if (this.tickets[index].tracking) { this.stopActiveTracker();