Show timer in bubble if timed activity exists

This commit is contained in:
manubo
2019-09-19 17:33:41 +02:00
parent 8a4cfccc6f
commit 714e9bd139
7 changed files with 87 additions and 20 deletions

View File

@@ -25,12 +25,13 @@ export function tabUpdated(tab, { messenger, settings }) {
messenger.once("newService", ({ payload: { service } }) => {
apiClient
.bookedHours(service)
.activitiesStatus(service)
.then(({ data }) => {
messenger.postMessage(tab, {
type: "showBubble",
payload: {
bookedHours: parseFloat(data[0]?.hours) || 0,
bookedHours: parseFloat(data.hours),
timedActivity: data.timed_activity,
service,
},
})
@@ -89,6 +90,7 @@ async function openPopup(tab, { service, messenger }) {
apiClient.activities(fromDate, toDate),
apiClient.schedules(fromDate, toDate),
])
const action = {
type: "openPopup",
payload: {