refactor(app): replace voice hooks with voice runtime and audio engine architecture
This commit is contained in:
@@ -922,8 +922,7 @@ describe("HostRuntimeStore", () => {
|
||||
|
||||
useSessionStore.getState().initializeSession(
|
||||
host.serverId,
|
||||
fakeClient as unknown as DaemonClient,
|
||||
null as any
|
||||
fakeClient as unknown as DaemonClient
|
||||
);
|
||||
store.syncHosts([host]);
|
||||
|
||||
@@ -1046,8 +1045,7 @@ describe("HostRuntimeStore", () => {
|
||||
|
||||
useSessionStore.getState().initializeSession(
|
||||
host.serverId,
|
||||
fakeClient as unknown as DaemonClient,
|
||||
null as any
|
||||
fakeClient as unknown as DaemonClient
|
||||
);
|
||||
store.syncHosts([host]);
|
||||
|
||||
@@ -1122,8 +1120,7 @@ describe("HostRuntimeStore", () => {
|
||||
|
||||
useSessionStore.getState().initializeSession(
|
||||
host.serverId,
|
||||
fakeClient as unknown as DaemonClient,
|
||||
null as any
|
||||
fakeClient as unknown as DaemonClient
|
||||
);
|
||||
store.syncHosts([host]);
|
||||
|
||||
|
||||
@@ -1822,6 +1822,15 @@ export function useHostRuntimeSession(serverId: string): {
|
||||
};
|
||||
}
|
||||
|
||||
export function useHostRuntimeIsConnected(serverId: string): boolean {
|
||||
const store = getHostRuntimeStore();
|
||||
return useSyncExternalStore(
|
||||
(onStoreChange) => store.subscribe(serverId, onStoreChange),
|
||||
() => isHostRuntimeConnected(store.getSnapshot(serverId)),
|
||||
() => isHostRuntimeConnected(store.getSnapshot(serverId))
|
||||
);
|
||||
}
|
||||
|
||||
export function useHosts(): HostProfile[] {
|
||||
const store = getHostRuntimeStore();
|
||||
return useSyncExternalStore(
|
||||
|
||||
Reference in New Issue
Block a user