From 3ba54892dadae7a8d1cf4f2eff1a93856de4a85c Mon Sep 17 00:00:00 2001 From: Shubham Vaidya Date: Tue, 17 Sep 2024 18:25:10 +0530 Subject: [PATCH] fix: subscribe but not updating if user goes back to listing and subscribe to another app (#1095) --- .../pages/AppDetail/components/AppDetailHeader/index.tsx | 8 +++++++- src/features/overlay/slice.ts | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/pages/AppDetail/components/AppDetailHeader/index.tsx b/src/components/pages/AppDetail/components/AppDetailHeader/index.tsx index e148b7b9b..b596d03a0 100644 --- a/src/components/pages/AppDetail/components/AppDetailHeader/index.tsx +++ b/src/components/pages/AppDetail/components/AppDetailHeader/index.tsx @@ -37,7 +37,7 @@ import CommonService from 'services/CommonService' import type { UseCaseType } from 'features/appManagement/types' import { userHasPortalRole } from 'services/AccessService' import type { RootState } from 'features/store' - +import { resetDialog } from 'features/overlay/slice' export interface AppDetailHeaderProps { item: AppDetails } @@ -73,6 +73,12 @@ export default function AppDetailHeader({ item }: AppDetailHeaderProps) { } } + useEffect(() => { + return () => { + dispatch(resetDialog()) + } + }, [dispatch]) + useEffect(() => { if (isDialogConfirmed) { setButtonLabel(t('content.appdetail.requested')) diff --git a/src/features/overlay/slice.ts b/src/features/overlay/slice.ts index 6483b0122..9bc30780f 100644 --- a/src/features/overlay/slice.ts +++ b/src/features/overlay/slice.ts @@ -43,6 +43,7 @@ const dialog = createSlice({ }, resetDialog: (state) => { state.isConfirmed = false + state.isOpen = false }, }, })