@@ -30,7 +30,7 @@ const roomCounterAtom = atomWithStorage<number>("last-room-id", 0);
30
30
const isRoomEnforceEncoding = ( value : string ) : value is EnforceEncoding => value === "h264" || value === "vp8" ;
31
31
32
32
export const CreateRoom : FC < Props > = ( { refetchIfNeeded, host } ) => {
33
- const { roomApi } = useServerSdk ( ) ;
33
+ const { roomApi, currentURISchema } = useServerSdk ( ) ;
34
34
const [ videoCodec , setEnforceEncodingInput ] = useAtom ( videoCodecAtomFamily ( host ) ) ;
35
35
const [ maxPeers , setMaxPeers ] = useAtom ( maxPeersAtom ( host ) ) ;
36
36
@@ -51,9 +51,10 @@ export const CreateRoom: FC<Props> = ({ refetchIfNeeded, host }) => {
51
51
const path = useAtomValue ( pathAtom ) ;
52
52
const serverToken = useAtomValue ( serverTokenAtom ) ;
53
53
54
- const addServer = ( host : string ) => {
54
+ const addServer = ( httpProtocol : string , host : string ) => {
55
55
setJellyfishServers ( ( current ) => {
56
- const id = `${ current . isHttps ? "https" : "http" } ://${ host } ${ path } ` ;
56
+ const id = `${ httpProtocol } ://${ host } ${ path } ` ;
57
+
57
58
return {
58
59
...current ,
59
60
[ id ] : {
@@ -183,8 +184,11 @@ export const CreateRoom: FC<Props> = ({ refetchIfNeeded, host }) => {
183
184
} )
184
185
. then ( ( response ) => {
185
186
if ( host !== response . data . data . jellyfish_address ) {
186
- showToastInfo ( `Room created on ${ response . data . data . jellyfish_address } ` ) ;
187
- addServer ( response . data . data . jellyfish_address ) ;
187
+ const protocol = currentURISchema ?? "http" ;
188
+
189
+ showToastInfo ( `Room created on ${ protocol } ://${ response . data . data . jellyfish_address } ` ) ;
190
+
191
+ addServer ( protocol , response . data . data . jellyfish_address ) ;
188
192
}
189
193
refetchIfNeeded ( ) ;
190
194
setRoomOrder ( ( prev ) => {
0 commit comments