moved to /dispatch and fixed Voice chat

This commit is contained in:
PxlLoewe
2025-04-15 19:43:06 -07:00
parent d0c779b66e
commit fd4be984b0
35 changed files with 658 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
import { create } from "zustand";
import { socket } from "../(dispatch)/socket";
import { socket } from "../dispatch/socket";
interface ConnectionStore {
isConnected: boolean;
@@ -12,7 +12,7 @@ interface ConnectionStore {
disconnect: () => void;
}
export const useConnectionStore = create<ConnectionStore>((set) => ({
export const useDispatchConnectionStore = create<ConnectionStore>((set) => ({
isConnected: false,
selectedZone: "LST_01",
connect: async (uid, selectedZone, logoffTime) =>
@@ -34,8 +34,8 @@ export const useConnectionStore = create<ConnectionStore>((set) => ({
}));
socket.on("connect", () => {
useConnectionStore.setState({ isConnected: true });
useDispatchConnectionStore.setState({ isConnected: true });
});
socket.on("disconnect", () => {
useConnectionStore.setState({ isConnected: false });
useDispatchConnectionStore.setState({ isConnected: false });
});