From 0f249cc28d9b4aec7ebac1f4218fc9c701876607 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 16 Oct 2023 20:49:20 -0400 Subject: [PATCH] fix: only set url if different --- src/components/Browser.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Browser.tsx b/src/components/Browser.tsx index 67ccbdf..955a960 100644 --- a/src/components/Browser.tsx +++ b/src/components/Browser.tsx @@ -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(