diff --git a/apps/dispatch-server/index.ts b/apps/dispatch-server/index.ts index bbb08eba..184746de 100644 --- a/apps/dispatch-server/index.ts +++ b/apps/dispatch-server/index.ts @@ -13,16 +13,6 @@ import { handleConnectDesktop } from "socket-events/connect-desktop"; import cookieParser from "cookie-parser"; import cors from "cors"; import { authMiddleware } from "modules/expressMiddleware"; -import { prisma, User } from "@repo/db"; -import { Request, Response, NextFunction } from "express"; - -declare global { - namespace Express { - interface Request { - user?: User | null; - } - } -} const app = express(); const server = createServer(app); diff --git a/apps/dispatch-server/modules/chron.ts b/apps/dispatch-server/modules/chron.ts new file mode 100644 index 00000000..e69de29b diff --git a/apps/dispatch/app/_components/navbar/Settings.tsx b/apps/dispatch/app/_components/navbar/Settings.tsx index ad9198be..5d72b0be 100644 --- a/apps/dispatch/app/_components/navbar/Settings.tsx +++ b/apps/dispatch/app/_components/navbar/Settings.tsx @@ -16,27 +16,37 @@ export const SettingsBtn = () => { queryKey: ["user", session.data?.user.id], queryFn: () => getUserAPI(session.data!.user.id), }); + const testSoundRef = useRef(null); const editUserMutation = useMutation({ mutationFn: ({ user }: { user: Prisma.UserUpdateInput }) => editUserAPI(session.data!.user.id, user), }); + useEffect(() => { + if (typeof window !== "undefined") { + testSoundRef.current = new Audio("/sounds/Melder3.wav"); + } + }, []); + const modalRef = useRef(null); const [inputDevices, setInputDevices] = useState([]); const [selectedDevice, setSelectedDevice] = useState( user?.settingsMicDevice || null, ); - const [showIndication, setShowInducation] = useState(false); + const [showIndication, setShowIndication] = useState(false); const [micVol, setMicVol] = useState(1); + const [dmeVolume, setDmeVol] = useState(0.8); const setMic = useAudioStore((state) => state.setMic); useEffect(() => { - if (user?.settingsMicDevice) { + if (user) { setSelectedDevice(user.settingsMicDevice); setMic(user.settingsMicDevice, user.settingsMicVolume || 1); + setMicVol(user.settingsMicVolume || 1); + setDmeVol(user.settingsDmeVolume || 0.8); } }, [user, setMic]); @@ -72,7 +82,7 @@ export const SettingsBtn = () => { value={selectedDevice ? selectedDevice : ""} onChange={(e) => { setSelectedDevice(e.target.value); - setShowInducation(true); + setShowIndication(true); }} >