feat: Multi Accounts (#237)

* wip: new sync

* wip: restructure routes

* update

* feat: improve sync

* feat: repost with multi-account

* feat: improve sync

* feat: publish with multi account

* fix: settings screen

* feat: add zap for multi accounts
This commit is contained in:
雨宮蓮
2024-10-22 16:00:06 +07:00
committed by GitHub
parent ba9c81a10a
commit cc7de41bfd
89 changed files with 2695 additions and 2911 deletions
+4 -3
View File
@@ -3,13 +3,13 @@ import { appSettings } from "@/commons";
import { Spinner } from "@/components";
import type { QueryClient } from "@tanstack/react-query";
import { Outlet, createRootRouteWithContext } from "@tanstack/react-router";
import { listen } from "@tauri-apps/api/event";
import type { OsType } from "@tauri-apps/plugin-os";
import { useEffect } from "react";
interface RouterContext {
queryClient: QueryClient;
platform: OsType;
accounts: string[];
}
export const Route = createRootRouteWithContext<RouterContext>()({
@@ -33,8 +33,9 @@ function Screen() {
}, []);
useEffect(() => {
const unlisten = listen("synchronized", async () => {
await queryClient.invalidateQueries();
const unlisten = events.negentropyEvent.listen(async (data) => {
const queryKey = [data.payload.kind.toLowerCase()];
await queryClient.invalidateQueries({ queryKey });
});
return () => {