From 8519b561b3e5720cb7d020ed0607dd333f1a0f7c Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 8 Jan 2020 21:23:02 +0100 Subject: [PATCH] improve markdown display --- src/page/file/view.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/page/file/view.js b/src/page/file/view.js index 60c128d..82f52a1 100644 --- a/src/page/file/view.js +++ b/src/page/file/view.js @@ -109,6 +109,7 @@ class FilePage extends React.PureComponent { onComponentFocused = () => { StatusBar.setHidden(false); + console.log('fileComponent Focused...'); NativeModules.Firebase.setCurrentScreen('File').then(result => { DeviceEventEmitter.addListener('onStoragePermissionGranted', this.handleStoragePermissionGranted); DeviceEventEmitter.addListener('onStoragePermissionRefused', this.handleStoragePermissionRefused); @@ -652,13 +653,13 @@ class FilePage extends React.PureComponent { const isPlayable = mediaType === 'video' || mediaType === 'audio'; const isViewable = mediaType === 'image' || mediaType === 'text'; - const { permanent_url: uri } = claim; - NativeModules.Firebase.track('purchase_uri', { uri: uri }); + const purchaseUrl = this.getPurchaseUrl(); + NativeModules.Firebase.track('purchase_uri', { uri: purchaseUrl }); if (!isPlayable) { this.checkStoragePermissionForDownload(); } else { - this.confirmPurchaseUri(uri, costInfo, !isPlayable); + this.confirmPurchaseUri(purchaseUrl, costInfo, !isPlayable); } if (isPlayable) { @@ -671,6 +672,19 @@ class FilePage extends React.PureComponent { } }; + getPurchaseUrl = () => { + const { claim, navigation } = this.props; + const { permanent_url: permanentUrl } = claim; + + let purchaseUrl; + if (navigation.state.params) { + const { uri, fullUri } = navigation.state.params; + purchaseUrl = fullUri || uri || permanentUrl; + } + + return purchaseUrl; + }; + onDownloadPressed = () => { this.checkStoragePermissionForDownload(); }; @@ -796,6 +810,11 @@ class FilePage extends React.PureComponent { '' + ' ' + ' ' + + ' ' + + ' ' + ' ' + ' ' + '
' + @@ -842,7 +861,7 @@ class FilePage extends React.PureComponent { {isResolvingUri && ( - + {__('Loading decentralized data...')}