mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-11-15 03:02:17 -05:00
turning into redoing all of the webrtc reading and publishing client side lol
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useSessionSelector } from '../context/SessionContext.jsx';
|
||||
|
||||
export default function useServerUrl() {
|
||||
const publicUrl = useSessionSelector((state) => state.session?.interInstances?.profile?.publicUrl);
|
||||
// The UI may be served by Vite while session data comes from the actual server.
|
||||
return useCallback((url) => new URL(url, publicUrl || window.location.origin).href, [publicUrl]);
|
||||
}
|
||||
Reference in New Issue
Block a user