Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libs/actions/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1452,9 +1452,9 @@ function lockAccount(accountID?: number, domainAccountID?: number, domainName?:
return API.makeRequestWithSideEffects(SIDE_EFFECT_REQUEST_COMMANDS.LOCK_ACCOUNT, params, {optimisticData, successData, failureData});
}

function requestUnlockAccount(accountID?: number) {
function requestUnlockAccount(accountID: number) {
const params: LockAccountParams = {
accountID: accountID ?? currentUserAccountID,
accountID,
};

API.write(WRITE_COMMANDS.REQUEST_UNLOCK_ACCOUNT, params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ConfirmationPage from '@components/ConfirmationPage';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
Expand All @@ -12,6 +13,7 @@ import ROUTES from '@src/ROUTES';

function UnlockAccountPage() {
const {translate} = useLocalize();
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const styles = useThemeStyles();
const icons = useMemoizedLazyExpensifyIcons(['EmptyStateSpyPigeon']);

Expand All @@ -33,7 +35,7 @@ function UnlockAccountPage() {
descriptionStyle={styles.colorMuted}
buttonText={translate('unlockAccountPage.chatWithConcierge')}
onButtonPress={() => {
requestUnlockAccount();
requestUnlockAccount(currentUserPersonalDetails.accountID);
Navigation.navigate(ROUTES.CONCIERGE);
}}
containerStyle={styles.h100}
Expand Down
11 changes: 0 additions & 11 deletions tests/actions/UserTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,17 +798,6 @@ describe('actions/User', () => {

expect(mockAPI.write).toHaveBeenCalledWith(WRITE_COMMANDS.REQUEST_UNLOCK_ACCOUNT, {accountID});
});

it('should fall back to currentUserAccountID when no accountID is provided', async () => {
const currentAccountID = 888;
await Onyx.merge(ONYXKEYS.SESSION, {accountID: currentAccountID, email: 'user@expensify.com'});
await waitForBatchedUpdates();

UserActions.requestUnlockAccount();
await waitForBatchedUpdates();

expect(mockAPI.write).toHaveBeenCalledWith(WRITE_COMMANDS.REQUEST_UNLOCK_ACCOUNT, {accountID: currentAccountID});
});
});

describe('respondToProactiveAppReview', () => {
Expand Down
Loading