Skip to content

Commit

Permalink
Enforce null room redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Oct 3, 2022
1 parent 361c3f4 commit 06bd852
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion apps/meteor/client/hooks/useReactiveQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const useReactiveQuery = <TQueryFnData, TData = TQueryFnData, TQueryKey e

if (c.firstRun) {
if (data === undefined) {
console.warn('Reactive query returned undefined:', queryKey);
reject(new Error('Reactive query returned undefined'));
} else {
resolve(data);
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/room/providers/RoomProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type RoomProviderProps = {
const RoomProvider = ({ rid, children }: RoomProviderProps): ReactElement => {
useRoomRolesManagement(rid);

const roomQuery = useReactiveQuery(['rooms', rid], ({ rooms }) => rooms.findOne({ _id: rid }));
const roomQuery = useReactiveQuery(['rooms', rid], ({ rooms }) => rooms.findOne({ _id: rid }) ?? null);

// TODO: the following effect is a workaround while we don't have a general and definitive solution for it
const homeRoute = useRoute('home');
Expand Down

0 comments on commit 06bd852

Please sign in to comment.