Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

rn: simplified code

Saúl Ibarra Corretgée4c3e15791da
diff --git a/react/features/app/components/AbstractApp.js b/react/features/app/components/AbstractApp.js
index 1c890fab50..0e41d21980 100644
--- a/react/features/app/components/AbstractApp.js
+++ b/react/features/app/components/AbstractApp.js
@@ -79,22 +79,6 @@ export class AbstractApp extends BaseApp<Props, *> {
});
}
- /**
- * Gets a {@code Location} object from the window with information about the
- * current location of the document. Explicitly defined to allow extenders
- * to override because React Native does not usually have a location
- * property on its window unless debugging remotely in which case the
- * browser that is the remote debugger will provide a location property on
- * the window.
- *
- * @public
- * @returns {Location} A {@code Location} object with information about the
- * current location of the document.
- */
- getWindowLocation() {
- return undefined;
- }
-
/**
* Creates an extra {@link ReactElement}s to be added (unconditionaly)
* alongside the main element.
diff --git a/react/features/app/components/App.web.js b/react/features/app/components/App.web.js
index 5e5bcae7a1..91fdfee0e2 100644
--- a/react/features/app/components/App.web.js
+++ b/react/features/app/components/App.web.js
@@ -17,16 +17,6 @@ import { AbstractApp } from './AbstractApp';
* @extends AbstractApp
*/
export class App extends AbstractApp {
- /**
- * Gets a Location object from the window with information about the current
- * location of the document.
- *
- * @inheritdoc
- */
- getWindowLocation() {
- return window.location;
- }
-
/**
* Overrides the parent method to inject {@link AtlasKitThemeProvider} as
* the top most component.
diff --git a/react/features/app/functions.any.js b/react/features/app/functions.any.js
deleted file mode 100644
index fbabebcde3..0000000000
--- a/react/features/app/functions.any.js
+++ /dev/null
@@ -1,32 +0,0 @@
-// @flow
-
-import { getAppProp } from '../base/app';
-import { toState } from '../base/redux';
-import { getServerURL } from '../base/settings';
-
-/**
- * Retrieves the default URL for the app. This can either come from a prop to
- * the root App component or be configured in the settings.
- *
- * @param {Function|Object} stateful - The redux store or {@code getState}
- * function.
- * @returns {string} - Default URL for the app.
- */
-export function getDefaultURL(stateful: Function | Object) {
- const state = toState(stateful);
- const { app } = state['features/base/app'];
-
- // If the execution environment provides a Location abstraction (e.g. a Web
- // browser), then we'll presume it's the one and only base URL it can be on.
- const windowLocation = app.getWindowLocation();
-
- if (windowLocation) {
- const href = windowLocation.toString();
-
- if (href) {
- return href;
- }
- }
-
- return getAppProp(state, 'defaultURL') || getServerURL(state);
-}
diff --git a/react/features/app/functions.native.js b/react/features/app/functions.native.js
index 6b0e8033e7..b28ebe2647 100644
--- a/react/features/app/functions.native.js
+++ b/react/features/app/functions.native.js
@@ -2,7 +2,23 @@
import { NativeModules } from 'react-native';
-export * from './functions.any';
+import { getAppProp } from '../base/app';
+import { toState } from '../base/redux';
+import { getServerURL } from '../base/settings';
+
+/**
+ * Retrieves the default URL for the app. This can either come from a prop to
+ * the root App component or be configured in the settings.
+ *
+ * @param {Function|Object} stateful - The redux store or {@code getState}
+ * function.
+ * @returns {string} - Default URL for the app.
+ */
+export function getDefaultURL(stateful: Function | Object) {
+ const state = toState(stateful);
+
+ return getAppProp(state, 'defaultURL') || getServerURL(state);
+}
/**
* Returns application name.
diff --git a/react/features/app/functions.web.js b/react/features/app/functions.web.js
index c2006d46bf..b389034b72 100644
--- a/react/features/app/functions.web.js
+++ b/react/features/app/functions.web.js
@@ -1,9 +1,29 @@
// @flow
-export * from './functions.any';
+import { toState } from '../base/redux';
+import { getServerURL } from '../base/settings';
declare var interfaceConfig: Object;
+/**
+ * Retrieves the default URL for the app. This can either come from a prop to
+ * the root App component or be configured in the settings.
+ *
+ * @param {Function|Object} stateful - The redux store or {@code getState}
+ * function.
+ * @returns {string} - Default URL for the app.
+ */
+export function getDefaultURL(stateful: Function | Object) {
+ const state = toState(stateful);
+ const { href } = window.location;
+
+ if (href) {
+ return href;
+ }
+
+ return getServerURL(state);
+}
+
/**
* Returns application name.
*