Skip to content

Commit 5968142

Browse files
committed
Revert "fix: run npm run format:write"
This reverts commit 7073ac6.
1 parent 52097c1 commit 5968142

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

packages/react/src/components/RoomProvider.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { RoomContext } from '../context';
55

66
/** @public */
77
export type RoomProviderPropsRoom = {
8-
room: Room;
8+
room: Room,
99
children: React.ReactNode;
1010
};
1111

1212
/** @public */
1313
export type RoomProviderPropsSession = {
14-
session: UseSessionReturn;
14+
session: UseSessionReturn,
1515
children: React.ReactNode;
1616
};
1717

@@ -30,5 +30,9 @@ export function RoomProvider(props: RoomProviderProps) {
3030
room = props.room;
3131
}
3232

33-
return <RoomContext.Provider value={room}>{props.children}</RoomContext.Provider>;
33+
return (
34+
<RoomContext.Provider value={room}>
35+
{props.children}
36+
</RoomContext.Provider>
37+
);
3438
}

packages/react/src/hooks/useSession.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ type UseSessionFixedOptions = UseSessionCommonOptions; // & RoomOptionsTokenSour
135135
type UseSessionConfigurableOptions = UseSessionCommonOptions & TokenSourceFetchOptions; // & RoomOptionsTokenSourceConfigurable FIXME: replace this!
136136

137137
/** Given two TokenSourceFetchOptions values, check to see if they are deep equal. */
138-
function areTokenSourceFetchOptionsEqual(a: TokenSourceFetchOptions, b: TokenSourceFetchOptions) {
138+
function areTokenSourceFetchOptionsEqual(
139+
a: TokenSourceFetchOptions,
140+
b: TokenSourceFetchOptions,
141+
) {
139142
for (const key of Object.keys(a) as Array<keyof TokenSourceFetchOptions>) {
140143
switch (key) {
141144
case 'roomName':
@@ -236,9 +239,7 @@ export function useSession(
236239
} else if (tokenSource instanceof TokenSourceFixed) {
237240
return { tokenSource, ...restOptions }; // as RoomOptionsTokenSourceFixed FIXME: add this!
238241
} else {
239-
throw new Error(
240-
'Specified token source is neither fixed nor configurable - is this value valid?',
241-
);
242+
throw new Error('Specified token source is neither fixed nor configurable - is this value valid?');
242243
}
243244
}, [tokenSource, restOptions]);
244245

@@ -251,9 +252,7 @@ export function useSession(
251252

252253
if (previousRoomValue.current) {
253254
if (!roomOptionsEqual && sessionActive) {
254-
log.warn(
255-
"Warning: useSession tokenSource / options parameters changed while session is active - this won't do anything. If you are intending to change room options, stop the session first with `session.stop()`.",
256-
);
255+
log.warn("Warning: useSession tokenSource / options parameters changed while session is active - this won't do anything. If you are intending to change room options, stop the session first with `session.stop()`.");
257256
return previousRoomValue.current;
258257
}
259258
if (roomOptionsEqual) {
@@ -523,14 +522,7 @@ export function useSession(
523522

524523
signal?.removeEventListener('abort', onSignalAbort);
525524
},
526-
[
527-
room,
528-
waitUntilDisconnected,
529-
tokenSourceFetch,
530-
waitUntilConnected,
531-
agent.waitUntilAvailable,
532-
end,
533-
],
525+
[room, waitUntilDisconnected, tokenSourceFetch, waitUntilConnected, agent.waitUntilAvailable, end],
534526
);
535527

536528
const prepareConnection = useCallback(async () => {

0 commit comments

Comments
 (0)