diff --git a/apps/meteor/client/providers/UserProvider/UserProvider.tsx b/apps/meteor/client/providers/UserProvider/UserProvider.tsx index b6e30134cdaa..cb3142b75d31 100644 --- a/apps/meteor/client/providers/UserProvider/UserProvider.tsx +++ b/apps/meteor/client/providers/UserProvider/UserProvider.tsx @@ -59,6 +59,14 @@ type UserProviderProps = { children: ReactNode; }; +const find = (...args: any[]) => { + console.log('DEBUGOAUTH', new Date().toISOString(), 'find on service configurations'); + const results = ServiceConfiguration.configurations.find(...args).fetch(); + + console.log('DEBUGOAUTH', new Date().toISOString(), 'results', results?.length); + return results; +}; + const UserProvider = ({ children }: UserProviderProps): ReactElement => { const isLdapEnabled = useSetting('LDAP_Enable'); const isCrowdEnabled = useSetting('CROWD_Enable'); @@ -142,26 +150,23 @@ const UserProvider = ({ children }: UserProviderProps): ReactElement => { }); }, queryAllServices: createReactiveSubscriptionFactory(() => - ServiceConfiguration.configurations - .find( - { - showButton: { $ne: false }, + find( + { + showButton: { $ne: false }, + }, + { + sort: { + service: 1, }, - { - sort: { - service: 1, - }, - }, - ) - .fetch() - .map( - ({ appId: _, ...service }) => - ({ - title: capitalize(String((service as any).service || '')), - ...service, - ...(config[(service as any).service] ?? {}), - } as any), - ), + }, + ).map( + ({ appId: _, ...service }) => + ({ + title: capitalize(String((service as any).service || '')), + ...service, + ...(config[(service as any).service] ?? {}), + } as any), + ), ), }), [userId, user, loginMethod],