Kaynağa Gözat

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

j8
Mihai Uscat 4 yıl önce
ebeveyn
işleme
9cf7199c0e
4 değiştirilmiş dosya ile 27 ekleme ve 3 silme
  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 Dosyayı Görüntüle

2858
             this._room = undefined;
2858
             this._room = undefined;
2859
             room = undefined;
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
             APP.store.dispatch(maybeRedirectToWelcomePage(values[0]));
2869
             APP.store.dispatch(maybeRedirectToWelcomePage(values[0]));
2863
         });
2870
         });
2864
     },
2871
     },

+ 13
- 2
react/features/app/actions.js Dosyayı Görüntüle

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

+ 0
- 0
static/close3.js Dosyayı Görüntüle


+ 6
- 0
webpack.config.js Dosyayı Görüntüle

225
         },
225
         },
226
         performance: getPerformanceHints(5 * 1024)
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
     // Because both video-blur-effect and rnnoise-processor modules are loaded
235
     // Because both video-blur-effect and rnnoise-processor modules are loaded
230
     // in a lazy manner using the loadScript function with a hard coded name,
236
     // in a lazy manner using the loadScript function with a hard coded name,

Loading…
İptal
Kaydet