From 17a491977d4b622f8502eceee0f7f93817c8e32a Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Tue, 22 Mar 2022 18:18:09 -0700 Subject: [PATCH 01/11] update statementPDF --- src/libs/actions/User.js | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 657558bf6dfb..11f2143d84ce 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -20,7 +20,6 @@ import * as Localize from '../Localize'; import * as CloseAccountActions from './CloseAccount'; import * as Link from './Link'; import getSkinToneEmojiFromIndex from '../../components/EmojiPicker/getSkinToneEmojiFromIndex'; -import fileDownload from '../fileDownload'; let sessionAuthToken = ''; let sessionEmail = ''; @@ -402,20 +401,19 @@ function joinScreenShare(accessToken, roomName) { /** * Downloads the statement PDF for the provided period * @param {String} period YYYYMM format + * @returns {Object} PDF download link and file name */ -function downloadStatementPDF(period) { - API.GetStatementPDF({period}) +function generateStatementPDF(period) { + return API.GetStatementPDF({period}) .then((response) => { - if (response.jsonCode === 200 && response.filename) { - const downloadFileName = `Expensify_Statement_${response.period}.pdf`; - const pdfURL = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}secure?secureType=pdfreport&filename=${response.filename}&downloadName=${downloadFileName}`; - - fileDownload(pdfURL, downloadFileName); - } else { - Growl.show(Localize.translateLocal('common.genericErrorMessage'), CONST.GROWL.ERROR, 3000); + if (response.jsonCode !== 200 || !response.filename) { + return; } - }) - .catch(() => Growl.show(Localize.translateLocal('common.genericErrorMessage'), CONST.GROWL.ERROR, 3000)); + + const downloadFileName = `Expensify_Statement_${response.period}.pdf`; + const pdfURL = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}secure?secureType=pdfreport&filename=${response.filename}&downloadName=${downloadFileName}`; + return {pdfURL, downloadFileName}; + }); } export { @@ -437,5 +435,5 @@ export { setFrequentlyUsedEmojis, joinScreenShare, clearScreenShareRequest, - downloadStatementPDF, + generateStatementPDF, }; From ec352adb16b60ee52c007e365d9acbd637395522 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Tue, 22 Mar 2022 18:18:31 -0700 Subject: [PATCH 02/11] convert into component --- src/pages/wallet/WalletStatementPage.js | 84 ++++++++++++++++++------- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index 544de898d428..38c6aae6f497 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -13,6 +13,9 @@ import compose from '../../libs/compose'; import CONFIG from '../../CONFIG'; import WalletStatementModal from '../../components/WalletStatementModal'; import * as User from '../../libs/actions/User'; +import fileDownload from '../../libs/fileDownload'; +import Growl from '../../libs/Growl'; +import CONST from '../../CONST'; const propTypes = { /** The route object passed to this page from the navigator */ @@ -29,28 +32,65 @@ const propTypes = { ...withLocalizePropTypes, }; -const WalletStatementPage = (props) => { - moment.locale(lodashGet(props, 'preferredLocale', 'en')); - const yearMonth = lodashGet(props.route.params, 'yearMonth', null); - const year = yearMonth.substring(0, 4) || moment().year(); - const month = yearMonth.substring(4) || moment().month(); - const monthName = moment(month, 'M').format('MMMM'); - const title = `${monthName} ${year} statement`; - const url = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}statement.php?period=${yearMonth}`; - return ( - - Navigation.dismissModal(true)} - onDownloadButtonPress={() => User.downloadStatementPDF(yearMonth)} - /> - - - ); -}; +class WalletStatementPage extends React.Component { + constructor(props) { + super(props); + + this.state = { + isDownloading: false, + }; + this.processDownload = this.processDownload.bind(this); + } + + processDownload(yearMonth) { + if (this.state.isDownloading) { + return; + } + + this.setState({ + isDownloading: true, + }); + + const {fileURL, fileName} = User.generateStatementPDF(yearMonth); + + if (!fileURL) { + Growl.show(this.props.translate('common.genericErrorMessage'), CONST.GROWL.ERROR, 5000); + this.setState({ + isDownloading: false, + }); + } else { + fileDownload(fileURL, fileName).then(() => { + this.setState({ + isDownloading: false, + }); + }); + } + } + + render() { + moment.locale(lodashGet(this.props, 'preferredLocale', 'en')); + const yearMonth = lodashGet(this.props.route.params, 'yearMonth', null); + const year = yearMonth.substring(0, 4) || moment().year(); + const month = yearMonth.substring(4) || moment().month(); + const monthName = moment(month, 'M').format('MMMM'); + const title = `${monthName} ${year} statement`; + const url = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}statement.php?period=${yearMonth}`; + + return ( + + Navigation.dismissModal(true)} + onDownloadButtonPress={() => this.processDownload(yearMonth)} + /> + + + ); + } +} WalletStatementPage.propTypes = propTypes; WalletStatementPage.displayName = 'WalletStatementPage'; From 640c6806202d7c21df16eac8fc60b36fb8de8541 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 23 Mar 2022 15:42:36 -0700 Subject: [PATCH 03/11] add key for walletStatement --- src/ONYXKEYS.js | 3 +++ src/libs/actions/User.js | 10 ++++---- src/pages/wallet/WalletStatementPage.js | 31 ++++++++++++++++++------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index e701f99ab6a1..45f0b61b7cc6 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -130,6 +130,9 @@ export default { // The user's credit cards CARD_LIST: 'cardList', + // Stores information about the user's saved statements + WALLET_STATEMENTS: 'walletStatements', + // Stores information about the active reimbursement account being set up REIMBURSEMENT_ACCOUNT: 'reimbursementAccount', diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 11f2143d84ce..3add95906e39 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -401,18 +401,18 @@ function joinScreenShare(accessToken, roomName) { /** * Downloads the statement PDF for the provided period * @param {String} period YYYYMM format - * @returns {Object} PDF download link and file name */ function generateStatementPDF(period) { - return API.GetStatementPDF({period}) + Onyx.merge(ONYXKEYS.WALLET_STATEMENTS, {isGenerating: true}); + API.GetStatementPDF({period}) .then((response) => { if (response.jsonCode !== 200 || !response.filename) { return; } - const downloadFileName = `Expensify_Statement_${response.period}.pdf`; - const pdfURL = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}secure?secureType=pdfreport&filename=${response.filename}&downloadName=${downloadFileName}`; - return {pdfURL, downloadFileName}; + Onyx.merge(ONYXKEYS.WALLET_STATEMENTS, {[period]: response.filename}); + }).finally(() => { + Onyx.merge(ONYXKEYS.WALLET_STATEMENTS, {isGenerating: false}); }); } diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index 38c6aae6f497..f9559797f504 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -29,6 +29,12 @@ const propTypes = { }).isRequired, }).isRequired, + walletStatement: PropTypes.shape({ + /** Whether the PDF file available for download or not */ + isGenerating: PropTypes.bool.isRequired, + + }).isRequired, + ...withLocalizePropTypes, }; @@ -40,6 +46,11 @@ class WalletStatementPage extends React.Component { isDownloading: false, }; this.processDownload = this.processDownload.bind(this); + this.yearMonth = lodashGet(this.props.route.params, 'yearMonth', null); + } + + componentDidMount() { + User.generateStatementPDF(this.yearMonth); } processDownload(yearMonth) { @@ -51,15 +62,15 @@ class WalletStatementPage extends React.Component { isDownloading: true, }); - const {fileURL, fileName} = User.generateStatementPDF(yearMonth); - - if (!fileURL) { + if (!this.props.walletStatement[yearMonth] || this.props.walletStatement.isGenerating) { Growl.show(this.props.translate('common.genericErrorMessage'), CONST.GROWL.ERROR, 5000); this.setState({ isDownloading: false, }); } else { - fileDownload(fileURL, fileName).then(() => { + const fileName = `Expensify_Statement_${yearMonth}.pdf`; + const pdfURL = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}secure?secureType=pdfreport&filename=${this.props.walletStatement[yearMonth]}&downloadName=${fileName}`; + fileDownload(pdfURL, fileName).then(() => { this.setState({ isDownloading: false, }); @@ -69,12 +80,11 @@ class WalletStatementPage extends React.Component { render() { moment.locale(lodashGet(this.props, 'preferredLocale', 'en')); - const yearMonth = lodashGet(this.props.route.params, 'yearMonth', null); - const year = yearMonth.substring(0, 4) || moment().year(); - const month = yearMonth.substring(4) || moment().month(); + const year = this.yearMonth.substring(0, 4) || moment().year(); + const month = this.yearMonth.substring(4) || moment().month(); const monthName = moment(month, 'M').format('MMMM'); const title = `${monthName} ${year} statement`; - const url = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}statement.php?period=${yearMonth}`; + const url = `${CONFIG.EXPENSIFY.EXPENSIFY_URL}statement.php?period=${this.yearMonth}`; return ( @@ -82,7 +92,7 @@ class WalletStatementPage extends React.Component { title={Str.recapitalize(title)} shouldShowDownloadButton onCloseButtonPress={() => Navigation.dismissModal(true)} - onDownloadButtonPress={() => this.processDownload(yearMonth)} + onDownloadButtonPress={() => this.processDownload(this.yearMonth)} /> Date: Wed, 23 Mar 2022 15:42:50 -0700 Subject: [PATCH 04/11] Update User.js --- src/libs/actions/User.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 3add95906e39..719dc41d60fe 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -15,7 +15,6 @@ import NetworkConnection from '../NetworkConnection'; import redirectToSignIn from './SignInRedirect'; import NameValuePair from './NameValuePair'; import Growl from '../Growl'; -import CONFIG from '../../CONFIG'; import * as Localize from '../Localize'; import * as CloseAccountActions from './CloseAccount'; import * as Link from './Link'; From 27908b1e5333e94e7ec0502980ba043fd2aca332 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 23 Mar 2022 15:51:42 -0700 Subject: [PATCH 05/11] rename to statement --- src/ONYXKEYS.js | 2 +- src/libs/actions/User.js | 6 +++--- src/pages/wallet/WalletStatementPage.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index 45f0b61b7cc6..62fd83231d33 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -131,7 +131,7 @@ export default { CARD_LIST: 'cardList', // Stores information about the user's saved statements - WALLET_STATEMENTS: 'walletStatements', + WALLET_STATEMENT: 'walletStatement', // Stores information about the active reimbursement account being set up REIMBURSEMENT_ACCOUNT: 'reimbursementAccount', diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 719dc41d60fe..895a1acf81be 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -402,16 +402,16 @@ function joinScreenShare(accessToken, roomName) { * @param {String} period YYYYMM format */ function generateStatementPDF(period) { - Onyx.merge(ONYXKEYS.WALLET_STATEMENTS, {isGenerating: true}); + Onyx.merge(ONYXKEYS.WALLET_STATEMENT, {isGenerating: true}); API.GetStatementPDF({period}) .then((response) => { if (response.jsonCode !== 200 || !response.filename) { return; } - Onyx.merge(ONYXKEYS.WALLET_STATEMENTS, {[period]: response.filename}); + Onyx.merge(ONYXKEYS.WALLET_STATEMENT, {[period]: response.filename}); }).finally(() => { - Onyx.merge(ONYXKEYS.WALLET_STATEMENTS, {isGenerating: false}); + Onyx.merge(ONYXKEYS.WALLET_STATEMENT, {isGenerating: false}); }); } diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index f9559797f504..ecf337e390e8 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -111,7 +111,7 @@ export default compose( key: ONYXKEYS.NVP_PREFERRED_LOCALE, }, walletStatement: { - key: ONYXKEYS.WALLET_STATEMENTS, + key: ONYXKEYS.WALLET_STATEMENT, }, }), )(WalletStatementPage); From 9fcb5593b6620f41fcdba45b8a64ff65ef828634 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Wed, 23 Mar 2022 16:15:57 -0700 Subject: [PATCH 06/11] making optional props --- src/pages/wallet/WalletStatementPage.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index ecf337e390e8..607fc3d52fa4 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -31,13 +31,19 @@ const propTypes = { walletStatement: PropTypes.shape({ /** Whether the PDF file available for download or not */ - isGenerating: PropTypes.bool.isRequired, + isGenerating: PropTypes.bool, - }).isRequired, + }), ...withLocalizePropTypes, }; +const defaultProps = { + walletStatement: { + isGenerating: false, + }, +}; + class WalletStatementPage extends React.Component { constructor(props) { super(props); @@ -103,6 +109,7 @@ class WalletStatementPage extends React.Component { } WalletStatementPage.propTypes = propTypes; +WalletStatementPage.defaultProps = defaultProps; WalletStatementPage.displayName = 'WalletStatementPage'; export default compose( withLocalize, From 5f77ba2896afad974a5fc462c7a682ece43965db Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Thu, 24 Mar 2022 13:39:49 -0700 Subject: [PATCH 07/11] update to cancel when complete --- src/libs/actions/User.js | 3 ++- src/pages/wallet/WalletStatementPage.js | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 895a1acf81be..c15c77d7a45a 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -400,10 +400,11 @@ function joinScreenShare(accessToken, roomName) { /** * Downloads the statement PDF for the provided period * @param {String} period YYYYMM format + * @returns {Promise} */ function generateStatementPDF(period) { Onyx.merge(ONYXKEYS.WALLET_STATEMENT, {isGenerating: true}); - API.GetStatementPDF({period}) + return API.GetStatementPDF({period}) .then((response) => { if (response.jsonCode !== 200 || !response.filename) { return; diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index 607fc3d52fa4..27de2d79434f 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -16,6 +16,7 @@ import * as User from '../../libs/actions/User'; import fileDownload from '../../libs/fileDownload'; import Growl from '../../libs/Growl'; import CONST from '../../CONST'; +import makeCancellablePromise from '../../libs/MakeCancellablePromise'; const propTypes = { /** The route object passed to this page from the navigator */ @@ -53,10 +54,20 @@ class WalletStatementPage extends React.Component { }; this.processDownload = this.processDownload.bind(this); this.yearMonth = lodashGet(this.props.route.params, 'yearMonth', null); + this.generatePDFPromise = null; } componentDidMount() { - User.generateStatementPDF(this.yearMonth); + this.generatePDFPromise = makeCancellablePromise(User.generateStatementPDF(this.yearMonth)); + } + + componentWillUnmount() { + if (!this.generatePDFPromise) { + return; + } + + this.generatePDFPromise.cancel(); + this.generatePDFPromise = null; } processDownload(yearMonth) { From 6fae87df3b3c955d0d147e02afea51c540a74d47 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Thu, 24 Mar 2022 13:41:39 -0700 Subject: [PATCH 08/11] unlink react native webview --- ios/Podfile | 1 - 1 file changed, 1 deletion(-) diff --git a/ios/Podfile b/ios/Podfile index 6ddfb790f587..db2612713022 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -17,7 +17,6 @@ target 'NewExpensify' do :hermes_enabled => true ) - pod 'react-native-webview', :path => '../node_modules/react-native-webview' target 'NewExpensifyTests' do inherit! :complete From 4efec357813a630183fa110f21d428f148783ab6 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Thu, 24 Mar 2022 13:47:19 -0700 Subject: [PATCH 09/11] podfile updates --- ios/NewExpensify.xcodeproj/project.pbxproj | 16 ++++++++-------- ios/Podfile.lock | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ios/NewExpensify.xcodeproj/project.pbxproj b/ios/NewExpensify.xcodeproj/project.pbxproj index de0bf9bf28ff..8f47635f6751 100644 --- a/ios/NewExpensify.xcodeproj/project.pbxproj +++ b/ios/NewExpensify.xcodeproj/project.pbxproj @@ -531,11 +531,11 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-NewExpensify-NewExpensifyTests/Pods-NewExpensify-NewExpensifyTests-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/double-conversion/double-conversion.framework/double-conversion", "${PODS_XCFRAMEWORKS_BUILD_DIR}/Onfido/Onfido.framework/Onfido", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/Plaid/LinkKit.framework/LinkKit", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework/hermes", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/LinkKit/LinkKit.framework/LinkKit", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes/hermes.framework/hermes", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -707,11 +707,11 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-NewExpensify/Pods-NewExpensify-frameworks.sh", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/Flipper-DoubleConversion/double-conversion.framework/double-conversion", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/double-conversion/double-conversion.framework/double-conversion", "${PODS_XCFRAMEWORKS_BUILD_DIR}/Onfido/Onfido.framework/Onfido", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL-Universal/OpenSSL.framework/OpenSSL", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/Plaid/LinkKit.framework/LinkKit", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/hermes.framework/hermes", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/OpenSSL/OpenSSL.framework/OpenSSL", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/LinkKit/LinkKit.framework/LinkKit", + "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes/hermes.framework/hermes", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 5fab81d28dc2..ef9a14d20a47 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -878,7 +878,7 @@ SPEC CHECKSUMS: Airship: 29d674abeac754f783fc46c7d383d6f046687341 boost: a7c83b31436843459a1961bfd74b96033dc77234 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 + DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de FBLazyVector: e5569e42a1c79ca00521846c223173a57aca1fe1 FBReactNativeSpec: fe08c1cd7e2e205718d77ad14b34957cce949b58 Firebase: 54cdc8bc9c9b3de54f43dab86e62f5a76b47034f @@ -900,7 +900,7 @@ SPEC CHECKSUMS: Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 FlipperKit: d8d346844eca5d9120c17d441a2f38596e8ed2b9 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 5337263514dd6f09803962437687240c5dc39aa4 + glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 GoogleAppMeasurement: 6b6a08fd9c71f4dbc89e0e812acca81d797aa342 GoogleDataTransport: 629c20a4d363167143f30ea78320d5a7eb8bd940 GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1 @@ -977,6 +977,6 @@ SPEC CHECKSUMS: Yoga: e7dc4e71caba6472ff48ad7d234389b91dadc280 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 1199d07d3ccd1ea23300ad9e27bc9287716223bf +PODFILE CHECKSUM: 431123d7514c52fa4516724b89c20d02c87ad8c8 COCOAPODS: 1.10.1 From ea4de796051caa36dfccd044ca419161bcb829db Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Thu, 24 Mar 2022 13:48:09 -0700 Subject: [PATCH 10/11] nab comment --- src/pages/wallet/WalletStatementPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/wallet/WalletStatementPage.js b/src/pages/wallet/WalletStatementPage.js index 27de2d79434f..d1056ec5c21a 100644 --- a/src/pages/wallet/WalletStatementPage.js +++ b/src/pages/wallet/WalletStatementPage.js @@ -33,7 +33,6 @@ const propTypes = { walletStatement: PropTypes.shape({ /** Whether the PDF file available for download or not */ isGenerating: PropTypes.bool, - }), ...withLocalizePropTypes, From 4c1380ead5a411e3ce0e23cb96cf6f1011540e95 Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Mon, 28 Mar 2022 12:08:19 -0700 Subject: [PATCH 11/11] add logs --- src/libs/actions/User.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index c15c77d7a45a..50c66c684551 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -407,6 +407,7 @@ function generateStatementPDF(period) { return API.GetStatementPDF({period}) .then((response) => { if (response.jsonCode !== 200 || !response.filename) { + Log.info('[User] Failed to generate statement PDF', false, {response}); return; }