|
|
@@ -1,5 +1,7 @@
|
|
1
|
1
|
/* @flow */
|
|
2
|
2
|
|
|
|
3
|
+import type { Dispatch } from 'redux';
|
|
|
4
|
+
|
|
3
|
5
|
import { setRoom } from '../base/conference';
|
|
4
|
6
|
import {
|
|
5
|
7
|
configWillLoad,
|
|
|
@@ -71,9 +73,17 @@ function _appNavigateToMandatoryLocation(
|
|
71
|
73
|
* @returns {void}
|
|
72
|
74
|
*/
|
|
73
|
75
|
function loadConfigSettled(error, config) {
|
|
74
|
|
- // FIXME Due to the asynchronous nature of the loading, the specified
|
|
|
76
|
+ // Due to the asynchronous nature of the loading, the specified
|
|
75
|
77
|
// config may or may not be required by the time the notification
|
|
76
|
|
- // arrives.
|
|
|
78
|
+ // arrives. If we receive the config for a location we are no longer
|
|
|
79
|
+ // interested in, just dump it.
|
|
|
80
|
+
|
|
|
81
|
+ const { locationURL: currentLocationURL }
|
|
|
82
|
+ = getState()['features/base/config'];
|
|
|
83
|
+
|
|
|
84
|
+ if (currentLocationURL !== newLocation) {
|
|
|
85
|
+ throw new Error('Config no longer needed');
|
|
|
86
|
+ }
|
|
77
|
87
|
|
|
78
|
88
|
const promise
|
|
79
|
89
|
= dispatch(setLocationURL(new URL(newLocation.toString())));
|