Browse Source

feat(close3): Move readyToClose flow to the close page

j8
Mihai Uscat 4 years ago
parent
commit
9cf7199c0e
4 changed files with 27 additions and 3 deletions
  1. 8
    1
      conference.js
  2. 13
    2
      react/features/app/actions.js
  3. 0
    0
      static/close3.js
  4. 6
    0
      webpack.config.js

+ 8
- 1
conference.js View File

@@ -2858,7 +2858,14 @@ export default {
2858 2858
             this._room = undefined;
2859 2859
             room = undefined;
2860 2860
 
2861
-            APP.API.notifyReadyToClose();
2861
+            /**
2862
+             * Don't call {@code notifyReadyToClose} if the promotional page flag is set
2863
+             * and let the page take care of sending the message, since there will be
2864
+             * a redirect to the page regardlessly.
2865
+             */
2866
+            if (!interfaceConfig.SHOW_PROMOTIONAL_CLOSE_PAGE) {
2867
+                APP.API.notifyReadyToClose();
2868
+            }
2862 2869
             APP.store.dispatch(maybeRedirectToWelcomePage(values[0]));
2863 2870
         });
2864 2871
     },

+ 13
- 2
react/features/app/actions.js View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 import type { Dispatch } from 'redux';
4 4
 
5
+import { API_ID } from '../../../modules/API/constants';
5 6
 import { setRoom } from '../base/conference';
6 7
 import {
7 8
     configWillLoad,
@@ -168,9 +169,11 @@ export function redirectWithStoredParams(pathname: string) {
168 169
  * window.location.pathname. If the specified pathname is relative, the context
169 170
  * root of the Web app will be prepended to the specified pathname before
170 171
  * assigning it to window.location.pathname.
172
+ * @param {string} hashParam - Optional hash param to assign to
173
+ * window.location.hash.
171 174
  * @returns {Function}
172 175
  */
173
-export function redirectToStaticPage(pathname: string) {
176
+export function redirectToStaticPage(pathname: string, hashParam: ?string) {
174 177
     return () => {
175 178
         const windowLocation = window.location;
176 179
         let newPathname = pathname;
@@ -184,6 +187,10 @@ export function redirectToStaticPage(pathname: string) {
184 187
             newPathname = getLocationContextRoot(windowLocation) + newPathname;
185 188
         }
186 189
 
190
+        if (hashParam) {
191
+            windowLocation.hash = hashParam;
192
+        }
193
+
187 194
         windowLocation.pathname = newPathname;
188 195
     };
189 196
 }
@@ -285,6 +292,7 @@ export function maybeRedirectToWelcomePage(options: Object = {}) {
285 292
         // if close page is enabled redirect to it, without further action
286 293
         if (enableClosePage) {
287 294
             const { isGuest, jwt } = getState()['features/base/jwt'];
295
+            let hashParam;
288 296
 
289 297
             // save whether current user is guest or not, and pass auth token,
290 298
             // before navigating to close page
@@ -294,12 +302,15 @@ export function maybeRedirectToWelcomePage(options: Object = {}) {
294 302
             let path = 'close.html';
295 303
 
296 304
             if (interfaceConfig.SHOW_PROMOTIONAL_CLOSE_PAGE) {
305
+                if (Number(API_ID) === API_ID) {
306
+                    hashParam = `#jitsi_meet_external_api_id=${API_ID}`;
307
+                }
297 308
                 path = 'close3.html';
298 309
             } else if (!options.feedbackSubmitted) {
299 310
                 path = 'close2.html';
300 311
             }
301 312
 
302
-            dispatch(redirectToStaticPage(`static/${path}`));
313
+            dispatch(redirectToStaticPage(`static/${path}`, hashParam));
303 314
 
304 315
             return;
305 316
         }

+ 0
- 0
static/close3.js View File


+ 6
- 0
webpack.config.js View File

@@ -225,6 +225,12 @@ module.exports = [
225 225
         },
226 226
         performance: getPerformanceHints(5 * 1024)
227 227
     }),
228
+    Object.assign({}, config, {
229
+        entry: {
230
+            'close3': './static/close3.js'
231
+        },
232
+        performance: getPerformanceHints(128 * 1024)
233
+    }),
228 234
 
229 235
     // Because both video-blur-effect and rnnoise-processor modules are loaded
230 236
     // in a lazy manner using the loadScript function with a hard coded name,

Loading…
Cancel
Save