Skip to content

Commit 465c038

Browse files
committed
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 kriskbx#16 kriskbx#11
1 parent 93ddcd9 commit 465c038

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

resources/assets/js/app.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ window.Vue.use(ToggleButton);
1111
const shell = window.state.shell;
1212
const ipc = window.state.ipc;
1313

14+
function transformFrame(frame) {
15+
return Object.assign({}, frame, { start: frame._start, stop: frame._stop });
16+
}
17+
1418
const app = new Vue({
1519
el: '#app',
1620
data: window.state.data,
@@ -54,7 +58,7 @@ const app = new Vue({
5458
},
5559
frames() {
5660
let frames = {};
57-
this.days.forEach(day => frames[day] = this.log.frames[day].sort((a, b) => a.start >= b.start ? 1 : -1));
61+
this.days.forEach(day => frames[day] = this.log.frames[day].map(transformFrame).sort((a, b) => a.start >= b.start ? 1 : -1));
5862
return frames;
5963
}
6064
},
@@ -71,7 +75,7 @@ const app = new Vue({
7175
this.log = data;
7276
});
7377
ipc.on('gtt-status', (event, status) => {
74-
this.running = status;
78+
this.running = status.map(transformFrame);
7579
this.loadingStatus = false;
7680
this.starting = false;
7781
this.stopping = false;
@@ -192,4 +196,4 @@ const app = new Vue({
192196
ipc.send('gtt-config-write', config);
193197
}
194198
}
195-
});
199+
});

0 commit comments

Comments
 (0)