|
@ -34,7 +34,7 @@ export async function pauseWorkout(workout) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export async function updateCooldownMins(workout, cooldownMin) { |
|
|
export async function updateCooldownMins(workout, cooldownMin) { |
|
|
return await runBack({query: "pauseWorkout", cooldownMin, ...workout}); |
|
|
|
|
|
|
|
|
return await runBack({query: "updateCooldownMins", cooldownMin, id: workout.id}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export function openWebsocket(workout) { |
|
|
export function openWebsocket(workout) { |
|
@ -43,7 +43,7 @@ export function openWebsocket(workout) { |
|
|
|
|
|
|
|
|
async function runBack(query) { |
|
|
async function runBack(query) { |
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
chrome.runtime.sendMessage(query, result => { |
|
|
|
|
|
|
|
|
window.chrome.runtime.sendMessage(query, result => { |
|
|
if (result.success) { |
|
|
if (result.success) { |
|
|
resolve(result.data) |
|
|
resolve(result.data) |
|
|
} else { |
|
|
} else { |
|
|