add searchparams port

This commit is contained in:
Janis
2023-07-24 00:47:55 +02:00
parent bd5ecc1ab0
commit da518bbd1e

View File

@@ -1,16 +1,14 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import "@styles/App.scss"; import "@styles/App.scss";
import { IChannel, IClient, IConnection, ITS5ConnectionHandler } from "@interfaces/teamspeak"; import { IClient } from "@interfaces/teamspeak";
import { useEffect, useState } from "react";
import Viewer from "./Viewer"; import Viewer from "./Viewer";
import { useSearchParams } from "react-router-dom"; import { useSearchParams } from "react-router-dom";
import { TS5ConnectionHandler } from "@handlers/teamspeak/connectionHandler";
import useTSRemoteApp from "./hooks/useTSRemoteApp"; import useTSRemoteApp from "./hooks/useTSRemoteApp";
export default function App() { export default function App() {
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
const { clients, channels, connections, activeConnectionId, currentChannel } = useTSRemoteApp({ const { clients, activeConnectionId, currentChannel } = useTSRemoteApp({
remoteAppPort: 5899, remoteAppPort: parseInt(searchParams.get("remoteAppPort") ?? "5899"),
}); });
return ( return (