Переглянути джерело

fix(info): respect path when linking to dial in page

master
Leonard Kim 7 роки тому
джерело
коміт
824a8a8864

+ 23
- 2
react/features/invite/components/info-dialog/InfoDialog.web.js Переглянути файл

@@ -268,8 +268,29 @@ class InfoDialog extends Component {
268 268
      * @returns {string}
269 269
      */
270 270
     _getDialInfoPageURL() {
271
-        return `${window.location.origin}/static/dialInInfo.html?room=${
272
-            encodeURIComponent(this.props._conferenceName)}`;
271
+        const origin = window.location.origin;
272
+        const encodedConferenceName
273
+            = encodeURIComponent(this.props._conferenceName);
274
+        const pathParts = window.location.pathname.split('/');
275
+
276
+        // More than two parts implies the path consists of more than the first
277
+        // forward slash and the meeting name. If that is the case, drop the
278
+        // last segment of the path, which we assume is the meeting name. This
279
+        // is necessary when is hosted on a url with a path.
280
+        if (pathParts.length > 2) {
281
+            pathParts.length = pathParts.length - 1;
282
+        }
283
+
284
+        const newPath = pathParts.reduce((accumulator, currentValue) => {
285
+            if (currentValue) {
286
+                return `${accumulator}/${currentValue}`;
287
+            }
288
+
289
+            return accumulator;
290
+        }, '');
291
+
292
+        return `${origin}${newPath}/static/dialInInfo.html?room=${
293
+            encodedConferenceName}`;
273 294
     }
274 295
 
275 296
     /**

Завантаження…
Відмінити
Зберегти