mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-22 13:19:05 +00:00
meeting page frontend fixes
This commit is contained in:
@@ -12,7 +12,7 @@ import { useAuth } from "./AuthProvider";
|
||||
* or, limitation or incorrect usage of .d type generator from json schema
|
||||
* */
|
||||
|
||||
const useAuthReady = () => {
|
||||
export const useAuthReady = () => {
|
||||
const auth = useAuth();
|
||||
|
||||
return {
|
||||
@@ -695,8 +695,6 @@ const MEETING_LIST_PATH_PARTIALS = [
|
||||
];
|
||||
|
||||
export function useRoomActiveMeetings(roomName: string | null) {
|
||||
const { isAuthenticated } = useAuthReady();
|
||||
|
||||
return $api.useQuery(
|
||||
"get",
|
||||
"/v1/rooms/{room_name}/meetings/active" satisfies `/v1/rooms/{room_name}/${typeof MEETINGS_ACTIVE_PATH_PARTIAL}`,
|
||||
@@ -706,7 +704,28 @@ export function useRoomActiveMeetings(roomName: string | null) {
|
||||
},
|
||||
},
|
||||
{
|
||||
enabled: !!roomName && isAuthenticated,
|
||||
enabled: !!roomName,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function useRoomGetMeeting(
|
||||
roomName: string | null,
|
||||
meetingId: string | null,
|
||||
) {
|
||||
return $api.useQuery(
|
||||
"get",
|
||||
"/v1/rooms/{room_name}/meetings/{meeting_id}",
|
||||
{
|
||||
params: {
|
||||
path: {
|
||||
room_name: roomName!,
|
||||
meeting_id: meetingId!,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
enabled: !!roomName && !!meetingId,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1 +1,7 @@
|
||||
export const roomUrl = (roomName: string) => `/${roomName}`;
|
||||
import { NonEmptyString } from "./utils";
|
||||
|
||||
export const roomUrl = (roomName: NonEmptyString) => `/${roomName}`;
|
||||
export const roomMeetingUrl = (
|
||||
roomName: NonEmptyString,
|
||||
meetingId: NonEmptyString,
|
||||
) => `${roomUrl(roomName)}/${meetingId}`;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { roomUrl } from "./routes";
|
||||
import { NonEmptyString } from "./utils";
|
||||
|
||||
export const roomAbsoluteUrl = (roomName: string) =>
|
||||
export const roomAbsoluteUrl = (roomName: NonEmptyString) =>
|
||||
`${window.location.origin}${roomUrl(roomName)}`;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { components } from "../reflector-api";
|
||||
|
||||
export const useWhereby = () => {
|
||||
const [wherebyLoaded, setWherebyLoaded] = useState(false);
|
||||
@@ -13,3 +14,9 @@ export const useWhereby = () => {
|
||||
}, []);
|
||||
return wherebyLoaded;
|
||||
};
|
||||
|
||||
export const getWherebyUrl = (
|
||||
meeting: Pick<components["schemas"]["Meeting"], "room_url" | "host_room_url">,
|
||||
) =>
|
||||
// host_room_url possible '' atm
|
||||
meeting.host_room_url || meeting.room_url;
|
||||
|
||||
Reference in New Issue
Block a user