Browse Source

okay?

master
Stian Fredrik Aune 4 years ago
parent
commit
cc07cead16
  1. 2
      my-bois/src/components/Misc.jsx
  2. 4
      my-bois/src/hooks/net.js

2
my-bois/src/components/Misc.jsx

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import {COLOR_VERY_BAD, colorByDiff} from "../helpers/color";
import {colorByDiff} from "../helpers/color";
import "./Misc.css"; import "./Misc.css";
import {diffString} from "../helpers/diff"; import {diffString} from "../helpers/diff";

4
my-bois/src/hooks/net.js

@ -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 {

Loading…
Cancel
Save