Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix start/stop/duration
Durations and start/stop weren’t displaying correctly as a “frame” has properties `_start` and `_stop` not `start` and `stop`.

Fixes #16 #11
  • Loading branch information
SimeonC committed Jul 2, 2018
commit 465c03826cc95251b8023fcc28af63c2a6971bcd
10 changes: 7 additions & 3 deletions resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ window.Vue.use(ToggleButton);
const shell = window.state.shell;
const ipc = window.state.ipc;

function transformFrame(frame) {
return Object.assign({}, frame, { start: frame._start, stop: frame._stop });
}

const app = new Vue({
el: '#app',
data: window.state.data,
Expand Down Expand Up @@ -54,7 +58,7 @@ const app = new Vue({
},
frames() {
let frames = {};
this.days.forEach(day => frames[day] = this.log.frames[day].sort((a, b) => a.start >= b.start ? 1 : -1));
this.days.forEach(day => frames[day] = this.log.frames[day].map(transformFrame).sort((a, b) => a.start >= b.start ? 1 : -1));
return frames;
}
},
Expand All @@ -71,7 +75,7 @@ const app = new Vue({
this.log = data;
});
ipc.on('gtt-status', (event, status) => {
this.running = status;
this.running = status.map(transformFrame);
this.loadingStatus = false;
this.starting = false;
this.stopping = false;
Expand Down Expand Up @@ -192,4 +196,4 @@ const app = new Vue({
ipc.send('gtt-config-write', config);
}
}
});
});