mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
Add an option to skip the cache.
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -331,12 +331,15 @@ let urlParamCache: {
|
|||||||
export const getUrlParams = (
|
export const getUrlParams = (
|
||||||
search = window.location.search,
|
search = window.location.search,
|
||||||
hash = window.location.hash,
|
hash = window.location.hash,
|
||||||
|
/** Skipping the cache might be needed in tests, to allow recomputing based on mocked platform changes. */
|
||||||
|
skipCache = false,
|
||||||
): UrlParams => {
|
): UrlParams => {
|
||||||
// Only run the param configuration if we do not yet have it cached for this url.
|
// Only run the param configuration if we do not yet have it cached for this url.
|
||||||
if (
|
if (
|
||||||
urlParamCache.search === search &&
|
urlParamCache.search === search &&
|
||||||
urlParamCache.hash === hash &&
|
urlParamCache.hash === hash &&
|
||||||
urlParamCache.params
|
urlParamCache.params &&
|
||||||
|
!skipCache
|
||||||
) {
|
) {
|
||||||
return urlParamCache.params;
|
return urlParamCache.params;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user