Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hazae41 committed Dec 13, 2023
1 parent 0e50088 commit a3a5b56
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/mods/foreground/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { useTotalPricedBalance } from "../entities/wallets/data"
import { useDisplayUsd } from "../entities/wallets/page"

export function HomePage() {
const IS_CHROME_EXTENSION = location.protocol === "chrome-extension:"
const IS_FIREFOX_EXTENSION = location.protocol === "moz-extension:"
const IS_SAFARI_EXTENSION = location.protocol === "safari-web-extension:"

const userData = useUserContext().unwrap()
const background = useBackgroundContext().unwrap()

Expand All @@ -27,9 +31,14 @@ export function HomePage() {
useEffect(() => {
getPersisted()

if (background.isExtension())
return
if (navigator.userAgent.toLowerCase().includes("firefox"))
return

const t = setInterval(getPersisted, 1000)
return () => clearTimeout(t)
}, [getPersisted])
}, [background, getPersisted])

const Body =
<PageBody>
Expand All @@ -52,7 +61,7 @@ export function HomePage() {
</div>
<div className="h-8" />
<div className="grow" />
{persisted === false && <>
{persisted === false && background.isWebsite() && <>
<div className="text-lg font-medium">
Alerts
</div>
Expand All @@ -67,7 +76,7 @@ export function HomePage() {
<div className="h-2" />
</div>
</>}
</PageBody>
</PageBody >

const Header =
<PageHeader title="Home" />
Expand Down

0 comments on commit a3a5b56

Please sign in to comment.