diff --git a/screens/Home/MyVcs/HistoryTab.tsx b/screens/Home/MyVcs/HistoryTab.tsx index 99af81e9..38b26f65 100644 --- a/screens/Home/MyVcs/HistoryTab.tsx +++ b/screens/Home/MyVcs/HistoryTab.tsx @@ -8,6 +8,7 @@ import { ActorRefFrom } from 'xstate'; import { vcItemMachine } from '../../../machines/vcItem'; import { useKebabPopUp } from '../../../components/KebabPopUpController'; import { Theme } from '../../../components/ui/styleUtils'; +import { isSameVC } from '../../../shared/constants'; export const HistoryTab: React.FC = (props) => { const { t } = useTranslation('HistoryTab'); @@ -30,7 +31,8 @@ export const HistoryTab: React.FC = (props) => { onDismiss={controller.DISMISS}> {controller.activities.map((activity) => { - if (activity._vcKey == props.vcKey) { + const vcKeyMatch = isSameVC(activity._vcKey, props.vcKey); + if (vcKeyMatch) { return ( ) => export const VC_ITEM_STORE_KEY_REGEX = '^vc:(UIN|VID):[0-9]+:[a-z0-9-]+:[true|false]+$'; +//To compare the vckey with requestId, when the vc is pinned +export const isSameVC = (vcKey: string, pinnedVcKey: string) => { + const requestId = vcKey.split(':')[3]; + const pinnedRequestId = pinnedVcKey.split(':')[3]; + return requestId === pinnedRequestId; +}; + export let individualId = ''; export const GET_INDIVIDUAL_ID = (ind_Id: string) => {