perf: Refactor getEnabledApps to filter on credentials passed (#10353)
Co-authored-by: Omar López <[email protected]> Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
20 files changed
+76
-27
No files matched your search
@@ -21,7 +21,7 @@ import getCalendarsEvents from "./getCalendarsEvents";
|
||||
const log = logger.getChildLogger({ prefix: ["CalendarManager"] });
|
||||
|
||||
export const getCalendarCredentials = (credentials: Array<CredentialPayload>) => {
|
||||
const calendarCredentials = getApps(credentials)
|
||||
const calendarCredentials = getApps(credentials, true)
|
||||
.filter((app) => app.type.endsWith("_calendar"))
|
||||
.flatMap((app) => {
|
||||
const credentials = app.credentials.flatMap((credential) => {
|
||||
|
||||
@@ -75,7 +75,7 @@ export default class EventManager {
|
||||
* @param user
|
||||
*/
|
||||
constructor(user: EventManagerUser) {
|
||||
const appCredentials = getApps(user.credentials).flatMap((app) =>
|
||||
const appCredentials = getApps(user.credentials, true).flatMap((app) =>
|
||||
app.credentials.map((creds) => ({ ...creds, appName: app.name }))
|
||||
);
|
||||
// This includes all calendar-related apps, traditional calendars such as Google Calendar
|
||||
|
||||
@@ -176,6 +176,7 @@ const createMeetingWithCalVideo = async (calEvent: CalendarEvent) => {
|
||||
appId: "daily-video",
|
||||
type: "daily_video",
|
||||
userId: null,
|
||||
teamId: null,
|
||||
key: dailyAppKeys,
|
||||
invalid: false,
|
||||
},
|
||||
@@ -199,6 +200,7 @@ const getRecordingsOfCalVideoByRoomName = async (
|
||||
appId: "daily-video",
|
||||
type: "daily_video",
|
||||
userId: null,
|
||||
teamId: null,
|
||||
key: dailyAppKeys,
|
||||
invalid: false,
|
||||
},
|
||||
@@ -220,6 +222,7 @@ const getDownloadLinkOfCalVideoByRecordingId = async (recordingId: string) => {
|
||||
appId: "daily-video",
|
||||
type: "daily_video",
|
||||
userId: null,
|
||||
teamId: null,
|
||||
key: dailyAppKeys,
|
||||
invalid: false,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user