mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-04 12:01:52 +02:00
Replace void with fireAndForget in proxy main.tsx
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,21 +7,24 @@ import { ProxyLayout } from "./components/ProxyLayout";
|
|||||||
import { listen, rpc } from "./lib/rpc";
|
import { listen, rpc } from "./lib/rpc";
|
||||||
import { initHotkeys } from "./lib/hotkeys";
|
import { initHotkeys } from "./lib/hotkeys";
|
||||||
import { applyChange, dataAtom, replaceAll } from "./lib/store";
|
import { applyChange, dataAtom, replaceAll } from "./lib/store";
|
||||||
|
import { fireAndForget } from "./lib/fireAndForget";
|
||||||
import "./main.css";
|
import "./main.css";
|
||||||
|
|
||||||
const queryClient = new QueryClient();
|
const queryClient = new QueryClient();
|
||||||
const jotaiStore = createStore();
|
const jotaiStore = createStore();
|
||||||
|
|
||||||
// Load initial models from the database
|
// Load initial models from the database
|
||||||
void rpc("list_models", {}).then((res) => {
|
fireAndForget(
|
||||||
jotaiStore.set(dataAtom, (prev) => replaceAll(prev, "http_exchange", res.httpExchanges));
|
rpc("list_models", {}).then((res) => {
|
||||||
});
|
jotaiStore.set(dataAtom, (prev) => replaceAll(prev, "http_exchange", res.httpExchanges));
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
// Register hotkeys from action metadata
|
// Register hotkeys from action metadata
|
||||||
void initHotkeys();
|
fireAndForget(initHotkeys());
|
||||||
|
|
||||||
// Subscribe to model change events from the backend
|
// Subscribe to model change events from the backend
|
||||||
void listen("model_write", (payload) => {
|
listen("model_write", (payload) => {
|
||||||
jotaiStore.set(dataAtom, (prev) =>
|
jotaiStore.set(dataAtom, (prev) =>
|
||||||
applyChange(prev, "http_exchange", payload.model, payload.change),
|
applyChange(prev, "http_exchange", payload.model, payload.change),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user