Quick fixes to core libs (#2263)
This commit is contained in:
parent
1a27edd462
commit
f7a2e1e7ac
2 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ export const getCalendar = (credential: Credential | null): Calendar | null => {
|
||||||
if (!credential) return null;
|
if (!credential) return null;
|
||||||
const { type: calendarType } = credential;
|
const { type: calendarType } = credential;
|
||||||
const calendarApp = appStore[calendarType.split("_").join("") as keyof typeof appStore];
|
const calendarApp = appStore[calendarType.split("_").join("") as keyof typeof appStore];
|
||||||
if (!calendarApp || !("lib" in calendarApp && "CalendarService" in calendarApp.lib)) {
|
if (!(calendarApp && "lib" in calendarApp && "CalendarService" in calendarApp.lib)) {
|
||||||
log.warn(`calendar of type ${calendarType} does not implemented`);
|
log.warn(`calendar of type ${calendarType} does not implemented`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ const getVideoAdapters = (withCredentials: Credential[]): VideoApiAdapter[] =>
|
||||||
withCredentials.reduce<VideoApiAdapter[]>((acc, cred) => {
|
withCredentials.reduce<VideoApiAdapter[]>((acc, cred) => {
|
||||||
const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`;
|
const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`;
|
||||||
const app = appStore[appName as keyof typeof appStore];
|
const app = appStore[appName as keyof typeof appStore];
|
||||||
if ("lib" in app && "VideoApiAdapter" in app.lib) {
|
if (app && "lib" in app && "VideoApiAdapter" in app.lib) {
|
||||||
const makeVideoApiAdapter = app.lib.VideoApiAdapter as VideoApiAdapterFactory;
|
const makeVideoApiAdapter = app.lib.VideoApiAdapter as VideoApiAdapterFactory;
|
||||||
const videoAdapter = makeVideoApiAdapter(cred);
|
const videoAdapter = makeVideoApiAdapter(cred);
|
||||||
acc.push(videoAdapter);
|
acc.push(videoAdapter);
|
||||||
|
|
Loading…
Reference in a new issue