diff --git a/src/component/modalTagSelector/view.js b/src/component/modalTagSelector/view.js index 8950a66..f0572b2 100644 --- a/src/component/modalTagSelector/view.js +++ b/src/component/modalTagSelector/view.js @@ -1,5 +1,5 @@ import React from 'react'; -import { Text, TouchableOpacity, View } from 'react-native'; +import { NativeModules, Text, TouchableOpacity, View } from 'react-native'; import { DEFAULT_FOLLOWED_TAGS } from 'lbry-redux'; import Button from 'component/button'; import Colors from 'styles/colors'; @@ -23,6 +23,7 @@ export default class ModalTagSelector extends React.PureComponent { } this.props.doToggleTagFollow(tag); + NativeModules.Firebase.track('tag_follow', { tag }); }; handleRemoveTag = tag => { @@ -31,6 +32,7 @@ export default class ModalTagSelector extends React.PureComponent { } this.props.doToggleTagFollow(tag); + NativeModules.Firebase.track('tag_unfollow', { tag }); }; render() { diff --git a/src/page/publish/view.js b/src/page/publish/view.js index 3c94144..9013c73 100644 --- a/src/page/publish/view.js +++ b/src/page/publish/view.js @@ -2,6 +2,7 @@ import React from 'react'; import { ActivityIndicator, Clipboard, + DeviceEventEmitter, Image, NativeModules, Picker, @@ -72,6 +73,7 @@ class PublishPage extends React.PureComponent { // gallery videos videos: null, + galleryThumbnailsChecked: false, // camera cameraType: RNCamera.Constants.Type.back, @@ -115,14 +117,20 @@ class PublishPage extends React.PureComponent { componentWillMount() { const { navigation } = this.props; this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused); + DeviceEventEmitter.addListener('onGalleryThumbnailsChecked', this.handleGalleryThumbnailsChecked); } componentWillUnmount() { if (this.didFocusListener) { this.didFocusListener.remove(); } + DeviceEventEmitter.removeListener('onGalleryThumbnailsChecked', this.handleGalleryThumbnailsChecked); } + handleGalleryThumbnailsChecked = () => { + this.setState({ galleryThumbnailsChecked: true }); + }; + onComponentFocused = () => { const { pushDrawerStack, setPlayerVisible } = this.props; @@ -513,16 +521,14 @@ class PublishPage extends React.PureComponent { render() { const { balance, navigation, notify, publishFormValues } = this.props; - const { thumbnailPath } = this.state; + const { canUseCamera, currentPhase, galleryThumbnailsChecked, thumbnailPath, videos } = this.state; let content; - if (Constants.PHASE_SELECTOR === this.state.currentPhase) { + if (Constants.PHASE_SELECTOR === currentPhase) { content = ( - {this.state.canUseCamera && ( - - )} + {canUseCamera && } @@ -542,12 +548,19 @@ class PublishPage extends React.PureComponent { - {(!this.state.videos || !thumbnailPath) && ( + {(!videos || !thumbnailPath || !galleryThumbnailsChecked) && ( )} - {this.state.videos && thumbnailPath && ( + {thumbnailPath && (!videos || videos.length === 0) && ( + + + We could not find any videos on your device. Take a photo or record a video to get started. + + + )} + {videos && thumbnailPath && galleryThumbnailsChecked && (