Skip to content

Commit

Permalink
fix: subscribe but not updating if user goes back to listing and subs…
Browse files Browse the repository at this point in the history
…cribe to another app (#1095)
  • Loading branch information
shubhamv-ss authored Sep 17, 2024
1 parent fd9dca0 commit 3ba5489
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -73,6 +73,12 @@ export default function AppDetailHeader({ item }: AppDetailHeaderProps) {
}
}

useEffect(() => {
return () => {
dispatch(resetDialog())
}
}, [dispatch])

useEffect(() => {
if (isDialogConfirmed) {
setButtonLabel(t('content.appdetail.requested'))
Expand Down
1 change: 1 addition & 0 deletions src/features/overlay/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const dialog = createSlice({
},
resetDialog: (state) => {
state.isConfirmed = false
state.isOpen = false
},
},
})
Expand Down

0 comments on commit 3ba5489

Please sign in to comment.