mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
fix(rn, web) await initialisation before dispatching appWillMount
This commit is contained in:
@@ -38,14 +38,12 @@ export class AbstractApp extends BaseApp<Props, *> {
|
||||
*
|
||||
* @inheritdoc
|
||||
*/
|
||||
componentDidMount() {
|
||||
super.componentDidMount();
|
||||
async componentDidMount() {
|
||||
await super.componentDidMount();
|
||||
|
||||
this._init.then(() => {
|
||||
// If a URL was explicitly specified to this React Component, then
|
||||
// open it; otherwise, use a default.
|
||||
this._openURL(toURLString(this.props.url) || this._getDefaultURL());
|
||||
});
|
||||
// If a URL was explicitly specified to this React Component, then
|
||||
// open it; otherwise, use a default.
|
||||
this._openURL(toURLString(this.props.url) || this._getDefaultURL());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,23 +51,23 @@ export class AbstractApp extends BaseApp<Props, *> {
|
||||
*
|
||||
* @inheritdoc
|
||||
*/
|
||||
componentDidUpdate(prevProps: Props) {
|
||||
async componentDidUpdate(prevProps: Props) {
|
||||
const previousUrl = toURLString(prevProps.url);
|
||||
const currentUrl = toURLString(this.props.url);
|
||||
const previousTimestamp = prevProps.timestamp;
|
||||
const currentTimestamp = this.props.timestamp;
|
||||
|
||||
this._init.then(() => {
|
||||
// Deal with URL changes.
|
||||
await this._init;
|
||||
|
||||
if (previousUrl !== currentUrl
|
||||
// Deal with URL changes.
|
||||
|
||||
// XXX Refer to the implementation of loadURLObject: in
|
||||
// ios/sdk/src/JitsiMeetView.m for further information.
|
||||
|| previousTimestamp !== currentTimestamp) {
|
||||
this._openURL(currentUrl || this._getDefaultURL());
|
||||
}
|
||||
});
|
||||
if (previousUrl !== currentUrl
|
||||
|
||||
// XXX Refer to the implementation of loadURLObject: in
|
||||
// ios/sdk/src/JitsiMeetView.m for further information.
|
||||
|| previousTimestamp !== currentTimestamp) {
|
||||
this._openURL(currentUrl || this._getDefaultURL());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,40 +81,45 @@ export class App extends AbstractApp {
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
componentDidMount() {
|
||||
super.componentDidMount();
|
||||
async componentDidMount() {
|
||||
await super.componentDidMount();
|
||||
|
||||
SplashScreen.hide();
|
||||
}
|
||||
|
||||
this._init.then(() => {
|
||||
const { dispatch, getState } = this.state.store;
|
||||
/**
|
||||
* Initializes feature flags and updates settings.
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
_extraInit() {
|
||||
const { dispatch, getState } = this.state.store;
|
||||
|
||||
// We set these early enough so then we avoid any unnecessary re-renders.
|
||||
dispatch(updateFlags(this.props.flags));
|
||||
// We set these early enough so then we avoid any unnecessary re-renders.
|
||||
dispatch(updateFlags(this.props.flags));
|
||||
|
||||
// Check if serverURL is configured externally and not allowed to change.
|
||||
const serverURLChangeEnabled = getFeatureFlag(getState(), SERVER_URL_CHANGE_ENABLED, true);
|
||||
// Check if serverURL is configured externally and not allowed to change.
|
||||
const serverURLChangeEnabled = getFeatureFlag(getState(), SERVER_URL_CHANGE_ENABLED, true);
|
||||
|
||||
if (!serverURLChangeEnabled) {
|
||||
// As serverURL is provided externally, so we push it to settings.
|
||||
if (typeof this.props.url !== 'undefined') {
|
||||
const { serverURL } = this.props.url;
|
||||
if (!serverURLChangeEnabled) {
|
||||
// As serverURL is provided externally, so we push it to settings.
|
||||
if (typeof this.props.url !== 'undefined') {
|
||||
const { serverURL } = this.props.url;
|
||||
|
||||
if (typeof serverURL !== 'undefined') {
|
||||
dispatch(updateSettings({ serverURL }));
|
||||
}
|
||||
if (typeof serverURL !== 'undefined') {
|
||||
dispatch(updateSettings({ serverURL }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dispatch(updateSettings(this.props.userInfo || {}));
|
||||
dispatch(updateSettings(this.props.userInfo || {}));
|
||||
|
||||
// Update settings with feature-flag.
|
||||
const callIntegrationEnabled = this.props.flags[CALL_INTEGRATION_ENABLED];
|
||||
// Update settings with feature-flag.
|
||||
const callIntegrationEnabled = this.props.flags[CALL_INTEGRATION_ENABLED];
|
||||
|
||||
if (typeof callIntegrationEnabled !== 'undefined') {
|
||||
dispatch(updateSettings({ disableCallIntegration: !callIntegrationEnabled }));
|
||||
}
|
||||
});
|
||||
if (typeof callIntegrationEnabled !== 'undefined') {
|
||||
dispatch(updateSettings({ disableCallIntegration: !callIntegrationEnabled }));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user