From a8cd4ff12cd240eaf2b858733dcc77860d00c6c0 Mon Sep 17 00:00:00 2001 From: Lyubomir Marinov Date: Sat, 4 Feb 2017 21:46:37 -0600 Subject: [PATCH] 1, not 2 names for 1 and the same abstraction window.location calls it reload so util/helpers shouldn't call it redirect because UI/util/UIUtil has it is own redirect which is the assign of window.location. --- modules/URL/ConferenceUrl.js | 4 ++-- modules/util/helpers.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/URL/ConferenceUrl.js b/modules/URL/ConferenceUrl.js index c700cc10d..5bc075043 100644 --- a/modules/URL/ConferenceUrl.js +++ b/modules/URL/ConferenceUrl.js @@ -1,6 +1,6 @@ const logger = require("jitsi-meet-logger").getLogger(__filename); -import { redirect } from '../util/helpers'; +import { replace } from '../util/helpers'; /** * The modules stores information about the URL used to start the conference and @@ -68,6 +68,6 @@ export default class ConferenceUrl { */ reload() { logger.info("Reloading the conference using URL: " + this.originalURL); - redirect(this.originalURL); + replace(this.originalURL); } } diff --git a/modules/util/helpers.js b/modules/util/helpers.js index 0bd7e9e1f..ef10528c5 100644 --- a/modules/util/helpers.js +++ b/modules/util/helpers.js @@ -23,11 +23,13 @@ export function reload () { } /** - * Redirects to new URL. + * Redirects to a specific new URL by replacing the current location (in the + * history). + * * @param {string} url the URL pointing to the location where the user should * be redirected to. */ -export function redirect (url) { +export function replace(url) { window.location.replace(url); }