add back reload prompt but it never shows up...

This commit is contained in:
Paul Miller
2023-04-10 10:48:29 -05:00
parent c93e0e8332
commit a3800f6bc5
2 changed files with 25 additions and 26 deletions

View File

@@ -4,10 +4,10 @@ import SafeArea from "~/components/SafeArea";
import NavBar from "~/components/NavBar"; import NavBar from "~/components/NavBar";
import Card from "~/components/Card"; import Card from "~/components/Card";
import { ButtonLink } from "~/components/Button"; import { ButtonLink } from "~/components/Button";
import PeerConnectModal from "./PeerConnectModal"; import PeerConnectModal from "~/components/PeerConnectModal";
// TODO: use this reload prompt for real // TODO: use this reload prompt for real
// import ReloadPrompt from "./Reload"; import ReloadPrompt from "~/components/Reload";
export default function App() { export default function App() {
return ( return (
@@ -16,8 +16,8 @@ export default function App() {
<header> <header>
<img src={logo} class="App-logo" alt="logo" /> <img src={logo} class="App-logo" alt="logo" />
</header> </header>
{/* <ReloadPrompt /> */}
<BalanceBox /> <BalanceBox />
<ReloadPrompt />
<Card title="Kitchen Sink"> <Card title="Kitchen Sink">
<PeerConnectModal /> <PeerConnectModal />
<ButtonLink target="_blank" rel="noopener noreferrer" href="https://faucet.mutinynet.com/?address=abc123">Tap the Faucet</ButtonLink> <ButtonLink target="_blank" rel="noopener noreferrer" href="https://faucet.mutinynet.com/?address=abc123">Tap the Faucet</ButtonLink>

View File

@@ -1,6 +1,10 @@
import type { Component } from 'solid-js' import type { Component } from 'solid-js'
import { Show } from 'solid-js' import { Show } from 'solid-js'
// pwa-register doesn't have types apparently
// @ts-ignore
import { useRegisterSW } from 'virtual:pwa-register/solid' import { useRegisterSW } from 'virtual:pwa-register/solid'
import Card from './Card'
import { Button } from './Button'
const ReloadPrompt: Component = () => { const ReloadPrompt: Component = () => {
const { const {
@@ -21,29 +25,24 @@ const ReloadPrompt: Component = () => {
setNeedRefresh(false) setNeedRefresh(false)
} }
// TODO: for now we're just going to have it be invisible return (
return (<></>) <Show when={offlineReady() || needRefresh()}>
<Card title="PWA settings">
// return ( <div>
// <div> <Show
// <Show when={offlineReady() || needRefresh()}> fallback={<span>New content available, click on reload button to update.</span>}
// <div> when={offlineReady()}
// <div> >
// <Show <span>App ready to work offline</span>
// fallback={<span>New content available, click on reload button to update.</span>} </Show>
// when={offlineReady()} </div>
// > <Show when={needRefresh()}>
// <span>App ready to work offline</span> <Button onClick={() => updateServiceWorker(true)}>Reload</Button>
// </Show> </Show>
// </div> <Button onClick={() => close()}>Close</Button>
// <Show when={needRefresh()}> </Card>
// <button onClick={() => updateServiceWorker(true)}>Reload</button> </Show>
// </Show> )
// <button onClick={() => close()}>Close</button>
// </div>
// </Show>
// </div>
// )
} }
export default ReloadPrompt export default ReloadPrompt