diff --git a/src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts b/src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts index 6e1f6e833609..070f83e19e0f 100644 --- a/src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts +++ b/src/libs/Notification/PushNotification/subscribeToReportCommentPushNotifications.ts @@ -59,7 +59,7 @@ export default function subscribeToReportCommentPushNotifications() { Log.info('[PushNotification] onSelected() - Navigation is ready. Navigating...', false, {reportID, reportActionID}); if (!reportBelongsToWorkspace) { - Navigation.navigateWithSwitchPolicyID({policyID: undefined, route: ROUTES.HOME}); + Navigation.navigateWithSwitchPolicyID({route: ROUTES.HOME}); } Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(String(reportID))); } catch (error) { diff --git a/src/libs/PolicyMembersUtils.ts b/src/libs/PolicyMembersUtils.ts index 12138129e134..4376de150f17 100644 --- a/src/libs/PolicyMembersUtils.ts +++ b/src/libs/PolicyMembersUtils.ts @@ -3,6 +3,7 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; import type {PolicyMembers} from '@src/types/onyx'; import {getCurrentUserAccountID} from './actions/Report'; +import {getPolicyMembersByIdWithoutCurrentUser} from './PolicyUtils'; let policyMembers: OnyxCollection; Onyx.connect({ @@ -17,11 +18,8 @@ function getPolicyMemberAccountIDs(policyID?: string) { } const currentUserAccountID = getCurrentUserAccountID(); - return policyMembers - ? Object.keys(policyMembers[`${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}`] ?? {}) - .map((policyMemberAccountID) => Number(policyMemberAccountID)) - .filter((policyMemberAccountID) => policyMemberAccountID !== currentUserAccountID) - : []; + + return getPolicyMembersByIdWithoutCurrentUser(policyMembers, policyID, currentUserAccountID); } export default getPolicyMemberAccountIDs; diff --git a/src/pages/WorkspaceSwitcherPage.js b/src/pages/WorkspaceSwitcherPage.js index 6c63617200c8..73734b5a5256 100644 --- a/src/pages/WorkspaceSwitcherPage.js +++ b/src/pages/WorkspaceSwitcherPage.js @@ -192,7 +192,7 @@ function WorkspaceSwitcherPage({policies}) {