|
@@ -23,7 +23,8 @@ import {
|
23
|
23
|
sendAnalytics
|
24
|
24
|
} from './react/features/analytics';
|
25
|
25
|
import {
|
26
|
|
- redirectWithStoredParams,
|
|
26
|
+ maybeRedirectToWelcomePage,
|
|
27
|
+ redirectToStaticPage,
|
27
|
28
|
reloadWithStoredParams
|
28
|
29
|
} from './react/features/app';
|
29
|
30
|
|
|
@@ -101,10 +102,7 @@ import {
|
101
|
102
|
trackAdded,
|
102
|
103
|
trackRemoved
|
103
|
104
|
} from './react/features/base/tracks';
|
104
|
|
-import {
|
105
|
|
- getLocationContextRoot,
|
106
|
|
- getJitsiMeetGlobalNS
|
107
|
|
-} from './react/features/base/util';
|
|
105
|
+import { getJitsiMeetGlobalNS } from './react/features/base/util';
|
108
|
106
|
import { addMessage } from './react/features/chat';
|
109
|
107
|
import { showDesktopPicker } from './react/features/desktop-picker';
|
110
|
108
|
import { appendSuffix } from './react/features/display-name';
|
|
@@ -211,77 +209,6 @@ function muteLocalVideo(muted) {
|
211
|
209
|
APP.store.dispatch(setVideoMuted(muted));
|
212
|
210
|
}
|
213
|
211
|
|
214
|
|
-/**
|
215
|
|
- * Check if the welcome page is enabled and redirects to it.
|
216
|
|
- * If requested show a thank you dialog before that.
|
217
|
|
- * If we have a close page enabled, redirect to it without
|
218
|
|
- * showing any other dialog.
|
219
|
|
- *
|
220
|
|
- * @param {object} options used to decide which particular close page to show
|
221
|
|
- * or if close page is disabled, whether we should show the thankyou dialog
|
222
|
|
- * @param {boolean} options.showThankYou - whether we should
|
223
|
|
- * show thank you dialog
|
224
|
|
- * @param {boolean} options.feedbackSubmitted - whether feedback was submitted
|
225
|
|
- */
|
226
|
|
-function maybeRedirectToWelcomePage(options) {
|
227
|
|
- // if close page is enabled redirect to it, without further action
|
228
|
|
- if (config.enableClosePage) {
|
229
|
|
- const { isGuest } = APP.store.getState()['features/base/jwt'];
|
230
|
|
-
|
231
|
|
- // save whether current user is guest or not, before navigating
|
232
|
|
- // to close page
|
233
|
|
- window.sessionStorage.setItem('guest', isGuest);
|
234
|
|
- redirectToStaticPage(`static/${
|
235
|
|
- options.feedbackSubmitted ? 'close.html' : 'close2.html'}`);
|
236
|
|
-
|
237
|
|
- return;
|
238
|
|
- }
|
239
|
|
-
|
240
|
|
- // else: show thankYou dialog only if there is no feedback
|
241
|
|
- if (options.showThankYou) {
|
242
|
|
- APP.store.dispatch(showNotification({
|
243
|
|
- titleArguments: { appName: interfaceConfig.APP_NAME },
|
244
|
|
- titleKey: 'dialog.thankYou'
|
245
|
|
- }));
|
246
|
|
- }
|
247
|
|
-
|
248
|
|
- // if Welcome page is enabled redirect to welcome page after 3 sec, if
|
249
|
|
- // there is a thank you message to be shown, 0.5s otherwise.
|
250
|
|
- if (config.enableWelcomePage) {
|
251
|
|
- setTimeout(
|
252
|
|
- () => {
|
253
|
|
- APP.store.dispatch(redirectWithStoredParams('/'));
|
254
|
|
- },
|
255
|
|
- options.showThankYou ? 3000 : 500);
|
256
|
|
- }
|
257
|
|
-}
|
258
|
|
-
|
259
|
|
-/**
|
260
|
|
- * Assigns a specific pathname to window.location.pathname taking into account
|
261
|
|
- * the context root of the Web app.
|
262
|
|
- *
|
263
|
|
- * @param {string} pathname - The pathname to assign to
|
264
|
|
- * window.location.pathname. If the specified pathname is relative, the context
|
265
|
|
- * root of the Web app will be prepended to the specified pathname before
|
266
|
|
- * assigning it to window.location.pathname.
|
267
|
|
- * @return {void}
|
268
|
|
- */
|
269
|
|
-function redirectToStaticPage(pathname) {
|
270
|
|
- const windowLocation = window.location;
|
271
|
|
- let newPathname = pathname;
|
272
|
|
-
|
273
|
|
- if (!newPathname.startsWith('/')) {
|
274
|
|
- // A pathname equal to ./ specifies the current directory. It will be
|
275
|
|
- // fine but pointless to include it because contextRoot is the current
|
276
|
|
- // directory.
|
277
|
|
- newPathname.startsWith('./')
|
278
|
|
- && (newPathname = newPathname.substring(2));
|
279
|
|
- newPathname = getLocationContextRoot(windowLocation) + newPathname;
|
280
|
|
- }
|
281
|
|
-
|
282
|
|
- windowLocation.pathname = newPathname;
|
283
|
|
-}
|
284
|
|
-
|
285
|
212
|
/**
|
286
|
213
|
* A queue for the async replaceLocalTrack action so that multiple audio
|
287
|
214
|
* replacements cannot happen simultaneously. This solves the issue where
|
|
@@ -347,7 +274,7 @@ class ConferenceConnector {
|
347
|
274
|
|
348
|
275
|
case JitsiConferenceErrors.NOT_ALLOWED_ERROR: {
|
349
|
276
|
// let's show some auth not allowed page
|
350
|
|
- redirectToStaticPage('static/authError.html');
|
|
277
|
+ APP.store.dispatch(redirectToStaticPage('static/authError.html'));
|
351
|
278
|
break;
|
352
|
279
|
}
|
353
|
280
|
|
|
@@ -2596,7 +2523,7 @@ export default {
|
2596
|
2523
|
room = undefined;
|
2597
|
2524
|
|
2598
|
2525
|
APP.API.notifyReadyToClose();
|
2599
|
|
- maybeRedirectToWelcomePage(values[0]);
|
|
2526
|
+ APP.store.dispatch(maybeRedirectToWelcomePage(values[0]));
|
2600
|
2527
|
});
|
2601
|
2528
|
},
|
2602
|
2529
|
|