fix: couldn't get adapter issue for few apps (#23813)
* fix: couldn't get adapter issue for few apps * Update videoClient.ts
This commit is contained in:
@@ -28,7 +28,15 @@ const getVideoAdapters = async (withCredentials: CredentialPayload[]): Promise<V
|
||||
const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`;
|
||||
log.silly("Getting video adapter for", safeStringify({ appName, cred: getPiiFreeCredential(cred) }));
|
||||
|
||||
const videoAdapterImport = VideoApiAdapterMap[appName as keyof typeof VideoApiAdapterMap];
|
||||
let videoAdapterImport = VideoApiAdapterMap[appName as keyof typeof VideoApiAdapterMap];
|
||||
|
||||
// fallback: transforms zoom_video to zoom
|
||||
if (!videoAdapterImport) {
|
||||
const appTypeVariant = cred.type.substring(0, cred.type.lastIndexOf("_"));
|
||||
log.silly(`Adapter not found for ${appName}, trying fallback ${appTypeVariant}`);
|
||||
|
||||
videoAdapterImport = VideoApiAdapterMap[appTypeVariant as keyof typeof VideoApiAdapterMap];
|
||||
}
|
||||
|
||||
if (!videoAdapterImport) {
|
||||
log.error(`Couldn't get adapter for ${appName}`);
|
||||
|
||||
Reference in New Issue
Block a user