fix: only set url if different

This commit is contained in:
Derrick Hammer 2023-10-16 20:49:20 -04:00
parent b4ae99b74c
commit 0f249cc28d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 1 deletions

View File

@ -192,7 +192,9 @@ export function Browser() {
const handleIframeLoad = () => {
try {
const newUrl = iframeRef?.current?.contentWindow?.location.href as string;
setUrl(newUrl);
if (url !== newUrl) {
setUrl(newUrl);
}
} catch (e) {
// This will catch errors related to cross-origin requests, in which case we can't access the iframe's contentWindow.location
console.warn(