Skip to content

Commit

Permalink
fix: fixed stopwatch timer buttons (event APIs no longer return events)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Sep 8, 2021
1 parent 4e64b61 commit 7feadde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/StopwatchEntry.vue
Expand Up @@ -52,10 +52,10 @@ export default {
},
methods: {
stop: async function () {
let new_event = JSON.parse(JSON.stringify(this.event));
const new_event = JSON.parse(JSON.stringify(this.event));
new_event.data.running = false;
new_event.duration = (moment() - moment(new_event.timestamp)) / 1000;
new_event = await this.$aw.replaceEvent(this.bucket_id, new_event);
await this.$aw.replaceEvent(this.bucket_id, new_event);
this.$emit('update', new_event);
},
save: async function (new_event) {
Expand Down
7 changes: 4 additions & 3 deletions src/views/Stopwatch.vue
Expand Up @@ -98,14 +98,15 @@ export default {
},
methods: {
startTimer: async function (label) {
const event = await this.$aw.insertEvent(this.bucket_id, {
const event = {
timestamp: new Date(),
data: {
running: true,
label: label,
},
});
this.events.unshift(event);
};
await this.$aw.heartbeat(this.bucket_id, 1, event);
await this.getEvents();
},
updateTimer: async function (new_event) {
Expand Down

1 comment on commit 7feadde

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.11.0 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.11.0 (click to expand)

CML watermark

Please sign in to comment.