setCurrentScreen tweaks

This commit is contained in:
Akinwale Ariwodola 2019-08-25 16:35:51 +01:00
parent 384550cc63
commit 68d99ac639
5 changed files with 40 additions and 40 deletions

View file

@ -43,21 +43,22 @@ class AboutPage extends React.PureComponent {
const { pushDrawerStack, setPlayerVisible } = this.props; const { pushDrawerStack, setPlayerVisible } = this.props;
pushDrawerStack(); pushDrawerStack();
setPlayerVisible(); setPlayerVisible();
NativeModules.Firebase.setCurrentScreen('About');
if (NativeModules.VersionInfo) { NativeModules.Firebase.setCurrentScreen('About').then(result => {
NativeModules.VersionInfo.getAppVersion().then(version => { if (NativeModules.VersionInfo) {
this.setState({ appVersion: version }); NativeModules.VersionInfo.getAppVersion().then(version => {
this.setState({ appVersion: version });
});
}
Lbry.version().then(info => {
this.setState({
versionInfo: info,
});
}); });
} Lbry.status().then(info => {
Lbry.version().then(info => { this.setState({
this.setState({ lbryId: info.installation_id,
versionInfo: info, });
});
});
Lbry.status().then(info => {
this.setState({
lbryId: info.installation_id,
}); });
}); });

View file

@ -45,14 +45,13 @@ class FirstRunScreen extends React.PureComponent {
}); });
if (NativeModules.FirstRun) { if (NativeModules.FirstRun) {
NativeModules.Firebase.setCurrentScreen('First Run');
NativeModules.FirstRun.isFirstRun().then(firstRun => { NativeModules.FirstRun.isFirstRun().then(firstRun => {
AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL); AsyncStorage.removeItem(Constants.KEY_FIRST_RUN_EMAIL);
AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING); AsyncStorage.removeItem(Constants.KEY_EMAIL_VERIFY_PENDING);
this.setState({ isFirstRun: firstRun }); this.setState({ isFirstRun: firstRun });
if (firstRun) { if (firstRun) {
NativeModules.Firebase.setCurrentScreen('First Run');
this.setState({ currentPage: FirstRunScreen.pages[0] }); this.setState({ currentPage: FirstRunScreen.pages[0] });
} else { } else {
// Not the first run. Navigate to the splash screen right away // Not the first run. Navigate to the splash screen right away

View file

@ -161,18 +161,18 @@ class PublishPage extends React.PureComponent {
const { pushDrawerStack, setPlayerVisible } = this.props; const { pushDrawerStack, setPlayerVisible } = this.props;
pushDrawerStack(); pushDrawerStack();
setPlayerVisible(); setPlayerVisible();
NativeModules.Firebase.setCurrentScreen('Publish'); NativeModules.Firebase.setCurrentScreen('New publish').then(result => {
NativeModules.Gallery.canUseCamera().then(canUseCamera => this.setState({ canUseCamera }));
NativeModules.Gallery.canUseCamera().then(canUseCamera => this.setState({ canUseCamera })); NativeModules.Gallery.getThumbnailPath().then(thumbnailPath => this.setState({ thumbnailPath }));
NativeModules.Gallery.getThumbnailPath().then(thumbnailPath => this.setState({ thumbnailPath })); this.setState(
this.setState( {
{ loadingVideos: true,
loadingVideos: true, },
}, () => {
() => { NativeModules.Gallery.getVideos().then(videos => this.setState({ videos, loadingVideos: false }));
NativeModules.Gallery.getVideos().then(videos => this.setState({ videos, loadingVideos: false })); }
} );
); });
}; };
getNewUri(name, channel) { getNewUri(name, channel) {

View file

@ -37,16 +37,16 @@ class SearchPage extends React.PureComponent {
const { pushDrawerStack, setPlayerVisible, query, search } = this.props; const { pushDrawerStack, setPlayerVisible, query, search } = this.props;
pushDrawerStack(); pushDrawerStack();
setPlayerVisible(); setPlayerVisible();
NativeModules.Firebase.setCurrentScreen('Search'); NativeModules.Firebase.setCurrentScreen('Search').then(result => {
const searchQuery = query || this.getSearchQuery();
const searchQuery = query || this.getSearchQuery(); if (searchQuery && searchQuery.trim().length > 0) {
if (searchQuery && searchQuery.trim().length > 0) { this.setState({
this.setState({ currentQuery: searchQuery,
currentQuery: searchQuery, currentUri: isURIValid(searchQuery) ? normalizeURI(searchQuery) : null,
currentUri: isURIValid(searchQuery) ? normalizeURI(searchQuery) : null, });
}); search(searchQuery);
search(searchQuery); }
} });
}; };
componentDidMount() { componentDidMount() {

View file

@ -23,9 +23,9 @@ class TransactionHistoryPage extends React.PureComponent {
const { fetchTransactions, pushDrawerStack, setPlayerVisible } = this.props; const { fetchTransactions, pushDrawerStack, setPlayerVisible } = this.props;
pushDrawerStack(); pushDrawerStack();
setPlayerVisible(); setPlayerVisible();
NativeModules.Firebase.setCurrentScreen('Transaction History'); NativeModules.Firebase.setCurrentScreen('Transaction History').then(result => {
fetchTransactions();
fetchTransactions(); });
}; };
componentDidMount() { componentDidMount() {