fix: live trade redirects only updating URL bar

This commit is contained in:
Face 2025-05-31 14:02:10 +03:00
parent 0e68eb8c42
commit 4e58d20e84
3 changed files with 40 additions and 13 deletions

View file

@ -89,8 +89,10 @@
setOpenMobile(false);
}
function handleTradeClick(coinSymbol: string) {
goto(`/coin/${coinSymbol.toLowerCase()}`);
async function handleTradeClick(coinSymbol: string) {
const targetPath = `/coin/${coinSymbol.toLowerCase()}`;
await goto(targetPath, { invalidateAll: true });
setOpenMobile(false);
}
@ -443,11 +445,7 @@
<Sidebar.MenuItem>
<Sidebar.MenuButton>
{#snippet child({ props }: { props: MenuButtonProps })}
<a
href="/legal/terms"
onclick={handleTermsClick}
class={`${props.class}`}
>
<a href="/legal/terms" onclick={handleTermsClick} class={`${props.class}`}>
<Scale />
<span>Terms of Service</span>
</a>
@ -457,11 +455,7 @@
<Sidebar.MenuItem>
<Sidebar.MenuButton>
{#snippet child({ props }: { props: MenuButtonProps })}
<a
href="/legal/privacy"
onclick={handlePrivacyClick}
class={`${props.class}`}
>
<a href="/legal/privacy" onclick={handlePrivacyClick} class={`${props.class}`}>
<ShieldCheck />
<span>Privacy Policy</span>
</a>

View file

@ -226,6 +226,10 @@ function connect(): void {
}
function setCoin(coinSymbol: string): void {
if (activeCoin !== coinSymbol && activeCoin !== '@global') {
unsubscribeFromPriceUpdates(activeCoin);
}
activeCoin = coinSymbol;
sendMessage({ type: 'set_coin', coinSymbol });
}