aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/client/components/SyncButton.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/components/SyncButton.tsx')
-rw-r--r--src/client/components/SyncButton.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/components/SyncButton.tsx b/src/client/components/SyncButton.tsx
index 1c214ad..805cb45 100644
--- a/src/client/components/SyncButton.tsx
+++ b/src/client/components/SyncButton.tsx
@@ -1,9 +1,12 @@
import { faArrowsRotate, faSpinner } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { useSync } from "../stores";
+import { useAtomValue, useSetAtom } from "jotai";
+import { isOnlineAtom, isSyncingAtom, syncActionAtom } from "../atoms";
export function SyncButton() {
- const { isOnline, isSyncing, sync } = useSync();
+ const isOnline = useAtomValue(isOnlineAtom);
+ const isSyncing = useAtomValue(isSyncingAtom);
+ const sync = useSetAtom(syncActionAtom);
const handleSync = async () => {
await sync();