Skip to content
Snippets Groups Projects
Unverified Commit 88be1337 authored by Gustavo Reis Bauer's avatar Gustavo Reis Bauer Committed by GitHub
Browse files

fix: Inactive Clients Not Refreshing Action Buttons After App Deployment (#34849)

parent 0517a056
No related branches found
No related tags found
No related merge requests found
---
"@rocket.chat/meteor": patch
---
Fixes an issue where losing connection could break app's action buttons
import { type IUIActionButton, type UIActionButtonContext } from '@rocket.chat/apps-engine/definition/ui';
import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks';
import { useEndpoint, useStream, useUserId } from '@rocket.chat/ui-contexts';
import { useConnectionStatus, useEndpoint, useStream, useUserId } from '@rocket.chat/ui-contexts';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import { useEffect } from 'react';
......@@ -8,14 +8,15 @@ export const getIdForActionButton = ({ appId, actionId }: IUIActionButton): stri
export const useAppActionButtons = <TContext extends `${UIActionButtonContext}`>(context?: TContext) => {
const queryClient = useQueryClient();
const apps = useStream('apps');
const uid = useUserId();
const { status } = useConnectionStatus();
const getActionButtons = useEndpoint('GET', '/apps/actionButtons');
const result = useQuery({
queryKey: ['apps', 'actionButtons'],
queryKey: ['apps', 'actionButtons', status],
enabled: status === 'connected',
queryFn: () => getActionButtons(),
...(context && {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment