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

Add splash screen related logs #6476

Merged
merged 4 commits into from
Dec 2, 2021
Merged
Changes from 2 commits
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
26 changes: 24 additions & 2 deletions src/Expensify.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'underscore';
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {PureComponent} from 'react';
Expand Down Expand Up @@ -64,6 +65,8 @@ class Expensify extends PureComponent {
constructor(props) {
super(props);

setTimeout(() => this.reportBootSplashStatus(), 30 * 1000);
kidroca marked this conversation as resolved.
Show resolved Hide resolved

// Initialize this client as being an active client
ActiveClientManager.init();
this.hideSplash = this.hideSplash.bind(this);
Expand Down Expand Up @@ -107,7 +110,7 @@ class Expensify extends PureComponent {
// that we can remove it again once the content is ready
const previousAuthToken = lodashGet(prevProps, 'session.authToken', null);
if (this.getAuthToken() && !previousAuthToken) {
BootSplash.show({fade: true});
this.showSplash();
}

if (this.getAuthToken() && this.props.initialReportDataLoaded && this.props.isSidebarLoaded) {
Expand All @@ -131,8 +134,27 @@ class Expensify extends PureComponent {
ActiveClientManager.init();
}

showSplash() {
Log.info('[BootSplash] showing splash screen', false);
BootSplash.show({fade: true});
}

hideSplash() {
BootSplash.hide({fade: true});
Log.info('[BootSplash] hiding splash screen', false);
BootSplash.hide({fade: true})
.catch(error => Log.alert('[BootSplash] hiding failed', {message: error.message, error}, false));
}

reportBootSplashStatus() {
BootSplash.getVisibilityStatus()
.then((status) => {
Log.info('[BootSplash] Splash screen status', false, {status});
kidroca marked this conversation as resolved.
Show resolved Hide resolved

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB: Extra line

if (status === 'visible') {
const parameters = _.omit(this.props, 'children');
Log.alert('[BootSplash] Still visible. Current <Expensify /> props', parameters, false);
kidroca marked this conversation as resolved.
Show resolved Hide resolved
}
});
}

render() {
Expand Down