Fix Question Mark appearing on address
This commit is contained in:
parent
d4bab45809
commit
4dfcb4645a
1 changed files with 4 additions and 2 deletions
|
@ -91,11 +91,13 @@ function ShowPage(props: Props) {
|
|||
const hostname = isDev ? 'localhost' : DOMAIN;
|
||||
if (canonicalUrlPath !== window.location.pathname && hostname === window.location.hostname) {
|
||||
const urlParams = new URLSearchParams(search);
|
||||
let replaceUrl = canonicalUrlPath;
|
||||
if (urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID)) {
|
||||
const listId = urlParams.get(COLLECTIONS_CONSTS.COLLECTION_ID) || '';
|
||||
urlParams.set(COLLECTIONS_CONSTS.COLLECTION_ID, listId);
|
||||
replaceUrl += `?${urlParams.toString()}`;
|
||||
}
|
||||
history.replaceState(history.state, '', `${canonicalUrlPath}?${urlParams.toString()}`);
|
||||
history.replaceState(history.state, '', replaceUrl);
|
||||
}
|
||||
}
|
||||
// @endif
|
||||
|
@ -106,7 +108,7 @@ function ShowPage(props: Props) {
|
|||
) {
|
||||
resolveUri(uri);
|
||||
}
|
||||
}, [resolveUri, isResolvingUri, canonicalUrl, uri, claimExists, haventFetchedYet, history, isMine, claimIsPending]);
|
||||
}, [resolveUri, isResolvingUri, canonicalUrl, uri, claimExists, haventFetchedYet, isMine, claimIsPending, search]);
|
||||
|
||||
// Don't navigate directly to repost urls
|
||||
// Always redirect to the actual content
|
||||
|
|
Loading…
Reference in a new issue