mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 07:05:24 +00:00
feat: rebuild desktop sync as linked server accounts, fix packaged plugin bundles and UI scaling
This commit is contained in:
1 parent
7c02daccf4
commit
6cd9a2846d
242 files changed
+39127
-8558
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { useSyncExternalStore } from "react";
|
||||
import { getSyncStatusSnapshot, subscribeSyncStatus } from "@/lib/sync-status";
|
||||
|
||||
/** The desktop's sync status, kept current while the component is mounted. */
|
||||
export function useSyncStatus() {
|
||||
return useSyncExternalStore(
|
||||
subscribeSyncStatus,
|
||||
getSyncStatusSnapshot,
|
||||
() => null,
|
||||
);
|
||||
}
|
||||
|
||||
/** What needs the user's attention in Sync, for the rail badge. */
|
||||
export function useSyncAttentionCount(): number | null {
|
||||
const status = useSyncStatus();
|
||||
if (!status?.linked) return null;
|
||||
const count =
|
||||
(status.conflicts ?? 0) +
|
||||
(status.errors ?? 0) +
|
||||
(status.status === "signed_out" ? 1 : 0);
|
||||
return count || null;
|
||||
}
|
||||
Reference in new issue
Block a user