fix: Error during booking when default app is a Static Link Video App and Event has Organizer default location selected. (#9734)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2023-06-23 19:04:34 +02:00
1 parent 0b704b9ed4
commit b731dfd421
3 files changed
+38 -12

No files matched your search

+10 -2
View File
@@ -23,9 +23,17 @@ const getVideoAdapters = async (withCredentials: CredentialPayload[]): Promise<V
for (const cred of withCredentials) {
const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`;
const app = await appStore[appName as keyof typeof appStore]();
const appImportFn = appStore[appName as keyof typeof appStore];
if (app && "lib" in app && "VideoApiAdapter" in app.lib) {
// Static Link Video Apps don't exist in packages/app-store/index.ts(it's manually maintained at the moment) and they aren't needed there anyway.
const app = appImportFn ? await appImportFn() : null;
if (!app) {
log.error(`Couldn't get adapter for ${appName}`);
continue;
}
if ("lib" in app && "VideoApiAdapter" in app.lib) {
const makeVideoApiAdapter = app.lib.VideoApiAdapter as VideoApiAdapterFactory;
const videoAdapter = makeVideoApiAdapter(cred);
videoAdapters.push(videoAdapter);