Skip to content

Commit e8b9f27

Browse files
fix: Disabled cache for outbound message providers (RocketChat#36995)
1 parent 399ab02 commit e8b9f27

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.changeset/lazy-kings-appear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@rocket.chat/meteor": patch
3+
---
4+
5+
Disables cache for outbound message providers to ensure UI is always up to date

apps/meteor/client/components/Omnichannel/OutboundMessage/hooks/useOutboundProvidersList.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type UseOutboundProvidersListProps<TData> = Omit<UseQueryOptions<OutboundProvide
1414
};
1515

1616
const useOutboundProvidersList = <TData = OutboundProvidersResponse>(options?: UseOutboundProvidersListProps<TData>) => {
17-
const { type = 'phone', enabled = true, staleTime, ...queryOptions } = options || {};
17+
const { type = 'phone', enabled = true, staleTime = 0, gcTime = 0, ...queryOptions } = options || {};
1818
const getProviders = useEndpoint('GET', '/v1/omnichannel/outbound/providers');
1919
const hasModule = useHasLicenseModule('outbound-messaging');
2020

@@ -24,6 +24,7 @@ const useOutboundProvidersList = <TData = OutboundProvidersResponse>(options?: U
2424
retry: 3,
2525
enabled: hasModule && enabled,
2626
staleTime,
27+
gcTime,
2728
...queryOptions,
2829
});
2930
};

0 commit comments

Comments
 (0)