Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parent thread disappears in LHN when deleting the thread first chat #27410

Merged
merged 8 commits into from
Sep 19, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: merge main
dukenv0307 committed Sep 15, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 028c034fca46a53f026a60e4acc175839116f7e3
2 changes: 1 addition & 1 deletion .github/workflows/testBuild.yml
Original file line number Diff line number Diff line change
@@ -354,6 +354,6 @@ jobs:
IOS: ${{ needs.iOS.result }}
WEB: ${{ needs.web.result }}
ANDROID_LINK: ${{steps.get_android_path.outputs.android_path}}
DESKTOP_LINK: https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/${{ env.PULL_REQUEST_NUMBER }}/NewExpensify.dmg
DESKTOP_LINK: https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/${{ env.PULL_REQUEST_NUMBER }}/NewExpensifyAdHoc.dmg
IOS_LINK: ${{steps.get_ios_path.outputs.ios_path}}
WEB_LINK: https://${{ env.PULL_REQUEST_NUMBER }}.pr-testing.expensify.com
18 changes: 9 additions & 9 deletions .storybook/theme.js
Original file line number Diff line number Diff line change
@@ -7,17 +7,17 @@ export default create({
fontBase: 'ExpensifyNeue-Regular',
fontCode: 'monospace',
base: 'dark',
appBg: colors.greenHighlightBackground,
colorPrimary: colors.greenDefaultButton,
appBg: colors.darkHighlightBackground,
colorPrimary: colors.darkDefaultButton,
colorSecondary: colors.green,
appContentBg: colors.greenAppBackground,
textColor: colors.white,
barTextColor: colors.white,
appContentBg: colors.darkAppBackground,
textColor: colors.darkPrimaryText,
barTextColor: colors.darkPrimaryText,
barSelectedColor: colors.green,
barBg: colors.greenAppBackground,
appBorderColor: colors.greenBorders,
inputBg: colors.greenHighlightBackground,
inputBorder: colors.greenBorders,
barBg: colors.darkAppBackground,
appBorderColor: colors.darkBorders,
inputBg: colors.darkHighlightBackground,
inputBorder: colors.darkBorders,
appBorderRadius: 8,
inputBorderRadius: 8,
});
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -90,8 +90,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001036901
versionName "1.3.69-1"
versionCode 1001037002
versionName "1.3.70-2"
}

flavorDimensions "default"
28 changes: 23 additions & 5 deletions config/electronBuilder.config.js
Original file line number Diff line number Diff line change
@@ -21,6 +21,24 @@ const macIcon = {
adhoc: './desktop/icon-adhoc.png',
};

const appIds = {
production: 'com.expensifyreactnative.chat',
staging: 'com.expensifyreactnative.dev.chat',
adhoc: 'com.expensifyreactnative.adhoc.chat',
};

const productNames = {
production: 'New Expensify',
staging: 'New Expensify Dev',
adhoc: 'New Expensify AdHoc',
};

const artifactNames = {
production: 'NewExpensify.dmg',
staging: 'NewExpensifyDev.dmg',
adhoc: 'NewExpensifyAdHoc.dmg',
};

const isCorrectElectronEnv = ['production', 'staging', 'adhoc'].includes(process.env.ELECTRON_ENV);

if (!isCorrectElectronEnv) {
@@ -32,8 +50,8 @@ if (!isCorrectElectronEnv) {
* It can be used to create local builds of the same, by omitting the `--publish` flag
*/
module.exports = {
appId: 'com.expensifyreactnative.chat',
productName: 'New Expensify',
appId: appIds[process.env.ELECTRON_ENV],
productName: productNames[process.env.ELECTRON_ENV],
extraMetadata: {
version,
},
@@ -46,8 +64,8 @@ module.exports = {
type: 'distribution',
},
dmg: {
title: 'New Expensify',
artifactName: 'NewExpensify.dmg',
title: productNames[process.env.ELECTRON_ENV],
artifactName: artifactNames[process.env.ELECTRON_ENV],
internetEnabled: true,
},
publish: [
@@ -65,7 +83,7 @@ module.exports = {
output: 'desktop-build',
},
protocols: {
name: 'New Expensify',
name: productNames[process.env.ELECTRON_ENV],
schemes: ['new-expensify'],
},
};
4 changes: 2 additions & 2 deletions ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.69</string>
<string>1.3.70</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@@ -40,7 +40,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.69.1</string>
<string>1.3.70.2</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
4 changes: 2 additions & 2 deletions ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.3.69</string>
<string>1.3.70</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.69.1</string>
<string>1.3.70.2</string>
</dict>
</plist>
29 changes: 9 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.69-1",
"version": "1.3.70-2",
"author": "Expensify, Inc.",
"homepage": "https://new.expensify.com",
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",
@@ -107,7 +107,7 @@
"patch-package": "^8.0.0",
"process": "^0.11.10",
"prop-types": "^15.7.2",
"pusher-js": "7.4.0",
"pusher-js": "8.3.0",
"react": "18.2.0",
"react-collapse": "^5.1.0",
"react-content-loader": "^6.1.0",
2 changes: 2 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
@@ -104,6 +104,7 @@ export default {
MONEY_REQUEST_SCAN_TAB: ':iouType/new/:reportID?/scan',
MONEY_REQUEST_DISTANCE_TAB: ':iouType/new/:reportID?/distance',
MONEY_REQUEST_WAYPOINT: ':iouType/new/waypoint/:waypointIndex',
MONEY_REQUEST_ADDRESS: ':iouType/new/address/:reportID?',
IOU_SEND_ADD_BANK_ACCOUNT: `${IOU_SEND}/add-bank-account`,
IOU_SEND_ADD_DEBIT_CARD: `${IOU_SEND}/add-debit-card`,
IOU_SEND_ENABLE_PAYMENTS: `${IOU_SEND}/enable-payments`,
@@ -118,6 +119,7 @@ export default {
getMoneyRequestMerchantRoute: (iouType: string, reportID = '') => `${iouType}/new/merchant/${reportID}`,
getMoneyRequestDistanceTabRoute: (iouType: string, reportID = '') => `${iouType}/new/${reportID}/distance`,
getMoneyRequestWaypointRoute: (iouType: string, waypointIndex: number) => `${iouType}/new/waypoint/${waypointIndex}`,
getMoneyRequestAddressRoute: (iouType: string, reportID = '') => `${iouType}/new/address/${reportID}`,
getMoneyRequestTagRoute: (iouType: string, reportID = '') => `${iouType}/new/tag/${reportID}`,
SPLIT_BILL_DETAILS: `r/:reportID/split/:reportActionID`,
getSplitBillDetailsRoute: (reportID: string, reportActionID: string) => `r/${reportID}/split/${reportActionID}`,
22 changes: 20 additions & 2 deletions src/components/AddPlaidBankAccount.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _ from 'underscore';
import React, {useEffect, useRef, useCallback} from 'react';
import React, {useEffect, useRef, useCallback, useMemo} from 'react';
import {ActivityIndicator, View} from 'react-native';
import {useIsFocused} from '@react-navigation/native';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import lodashGet from 'lodash/get';
@@ -38,6 +39,9 @@ const propTypes = {
/** Fired when the user exits the Plaid flow */
onExitPlaid: PropTypes.func,

/** Fired when the screen is blurred */
onBlurPlaid: PropTypes.func,

/** Fired when the user selects an account */
onSelect: PropTypes.func,

@@ -61,6 +65,7 @@ const defaultProps = {
selectedPlaidAccountID: '',
plaidLinkToken: '',
onExitPlaid: () => {},
onBlurPlaid: () => {},
onSelect: () => {},
text: '',
receivedRedirectURI: null,
@@ -75,6 +80,7 @@ function AddPlaidBankAccount({
selectedPlaidAccountID,
plaidLinkToken,
onExitPlaid,
onBlurPlaid,
onSelect,
text,
receivedRedirectURI,
@@ -88,6 +94,7 @@ function AddPlaidBankAccount({

const {translate} = useLocalize();
const {isOffline} = useNetwork();
const isFocused = useIsFocused();

/**
* @returns {String}
@@ -102,6 +109,11 @@ function AddPlaidBankAccount({
}
};

/**
* @returns {Array}
*/
const plaidBankAccounts = useMemo(() => lodashGet(plaidData, 'bankAccounts') || [], [plaidData]);

/**
* @returns {Boolean}
* I'm using useCallback so the useEffect which uses this function doesn't run on every render.
@@ -151,6 +163,13 @@ function AddPlaidBankAccount({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
if (isFocused || plaidBankAccounts.length) {
return;
}
onBlurPlaid();
}, [isFocused, onBlurPlaid, plaidBankAccounts.length]);

useEffect(() => {
// If we are coming back from offline and we haven't authenticated with Plaid yet, we need to re-run our call to kick off Plaid
// previousNetworkState.current also makes sure that this doesn't run on the first render.
@@ -160,7 +179,6 @@ function AddPlaidBankAccount({
previousNetworkState.current = isOffline;
}, [allowDebit, bankAccountID, isAuthenticatedWithPlaid, isOffline]);

const plaidBankAccounts = lodashGet(plaidData, 'bankAccounts') || [];
const token = getPlaidLinkToken();
const options = _.map(plaidBankAccounts, (account) => ({
value: account.plaidAccountID,
4 changes: 2 additions & 2 deletions src/components/ConfirmedRoute.js
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ import transactionPropTypes from './transactionPropTypes';
import BlockingView from './BlockingViews/BlockingView';
import useNetwork from '../hooks/useNetwork';
import useLocalize from '../hooks/useLocalize';
import MapView from './MapView';
import DistanceMapView from './DistanceMapView';

const propTypes = {
/** Transaction that stores the distance request data */
@@ -90,7 +90,7 @@ function ConfirmedRoute({mapboxAccessToken, transaction}) {
return (
<>
{!isOffline && Boolean(mapboxAccessToken.token) ? (
<MapView
<DistanceMapView
accessToken={mapboxAccessToken.token}
mapPadding={CONST.MAP_PADDING}
pitchEnabled={false}
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import Text from '../Text';
import Icon from '../Icon';
import * as Illustrations from '../Icon/Illustrations';
import * as Expensicons from '../Icon/Expensicons';
import colors from '../../styles/colors';
import themeColors from '../../styles/themes/default';
import styles from '../../styles/styles';
import withLocalize, {withLocalizePropTypes} from '../withLocalize';
import Navigation from '../../libs/Navigation/Navigation';
@@ -56,7 +56,7 @@ function DeeplinkRedirectLoadingIndicator({translate, openLinkInBrowser, session
<Icon
width={154}
height={34}
fill={colors.green}
fill={themeColors.success}
src={Expensicons.ExpensifyWordmark}
/>
</View>
Loading