Skip to content

Commit

Permalink
FIX: remove '/' from host in client-control(#1156)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-Arc authored Jul 30, 2024
1 parent e500fa6 commit ce8b0d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 1 addition & 3 deletions apps/client/src/common/hooks/useClientPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion apps/client/src/common/utils/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down

0 comments on commit ce8b0d9

Please sign in to comment.