FIX: remove '/' from host in client-control(#1156)

This commit is contained in:
Alex Christoffer Rasmussen
2024-07-30 12:36:31 +02:00
committed by GitHub
parent e500fa6b5e
commit ce8b0d9850
3 changed files with 4 additions and 5 deletions
@@ -38,7 +38,7 @@ export function RedirectClientModal(props: RedirectClientModalProps) {
onClose();
};
const host = `${window.location.origin}/`;
const host = window.location.origin;
const canSubmit = path !== currentPath && path !== '';
return (
@@ -12,9 +12,7 @@ export const useClientPath = () => {
// notify of client path changes
useEffect(() => {
//remove leading '/' from path
const fullPath = (pathname.startsWith('/') ? pathname.slice(1) : pathname) + search;
socketSendJson('set-client-path', fullPath);
socketSendJson('set-client-path', pathname + search);
}, [pathname, search]);
// navigate to new path when received from server
+2 -1
View File
@@ -36,7 +36,8 @@ export const connectSocket = () => {
}
socketSendJson('set-client-type', 'ontime');
socketSendJson('set-client-path', location.pathname);
socketSendJson('set-client-path', location.pathname + location.search);
};
websocket.onclose = () => {