From b698224c4a16e7e53f9839850a114ba227eb9297 Mon Sep 17 00:00:00 2001 From: Beatrice Guerra Date: Fri, 7 Apr 2023 12:04:01 +0200 Subject: [PATCH] fix: call noOp request on update view action Revert noop replacement made with a7554b53 refs: SHELL-55 (#234) --- src/network/fetch.ts | 4 ++-- src/utility-bar/bar.tsx | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/network/fetch.ts b/src/network/fetch.ts index 5a98273d..ea7602b7 100644 --- a/src/network/fetch.ts +++ b/src/network/fetch.ts @@ -20,7 +20,7 @@ import { IS_STANDALONE, SHELL_APP_ID } from '../constants'; import { useNetworkStore } from '../store/network'; import { handleSync } from '../store/network/utils'; -export const noOp = (): void => { +export const fetchNoOp = (): void => { // eslint-disable-next-line @typescript-eslint/no-use-before-define getSoapFetch(SHELL_APP_ID)( 'NoOp', @@ -130,7 +130,7 @@ const handleResponse = (api: string, res: SoapResponse): R | ErrorSoapBody ? 10000 : pollingInterval; useNetworkStore.setState({ - noOpTimeout: setTimeout(() => noOp(), nextPollingInterval), + noOpTimeout: setTimeout(() => fetchNoOp(), nextPollingInterval), pollingInterval: nextPollingInterval, seq, ..._context diff --git a/src/utility-bar/bar.tsx b/src/utility-bar/bar.tsx index e86b59ff..bd38e90b 100644 --- a/src/utility-bar/bar.tsx +++ b/src/utility-bar/bar.tsx @@ -20,6 +20,7 @@ import { getT } from '../store/i18n'; import { useUtilityBarStore } from './store'; import { useUtilityViews } from './utils'; import { SHELL_APP_ID } from '../constants'; +import { fetchNoOp } from '../network/fetch'; const UtilityBarItem: FC<{ view: UtilityView }> = ({ view }) => { const { mode, setMode, current, setCurrent } = useUtilityBarStore(); @@ -80,7 +81,7 @@ export const ShellUtilityBar = (): JSX.Element => { { id: 'update', label: t('label.update_view', 'Update view'), - onClick: noop, + onClick: fetchNoOp, icon: 'Refresh' }, {