mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-20 15:54:22 +01:00
add back reload prompt but it never shows up...
This commit is contained in:
@@ -4,10 +4,10 @@ import SafeArea from "~/components/SafeArea";
|
||||
import NavBar from "~/components/NavBar";
|
||||
import Card from "~/components/Card";
|
||||
import { ButtonLink } from "~/components/Button";
|
||||
import PeerConnectModal from "./PeerConnectModal";
|
||||
import PeerConnectModal from "~/components/PeerConnectModal";
|
||||
|
||||
// TODO: use this reload prompt for real
|
||||
// import ReloadPrompt from "./Reload";
|
||||
import ReloadPrompt from "~/components/Reload";
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
@@ -16,8 +16,8 @@ export default function App() {
|
||||
<header>
|
||||
<img src={logo} class="App-logo" alt="logo" />
|
||||
</header>
|
||||
{/* <ReloadPrompt /> */}
|
||||
<BalanceBox />
|
||||
<ReloadPrompt />
|
||||
<Card title="Kitchen Sink">
|
||||
<PeerConnectModal />
|
||||
<ButtonLink target="_blank" rel="noopener noreferrer" href="https://faucet.mutinynet.com/?address=abc123">Tap the Faucet</ButtonLink>
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import type { Component } 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 Card from './Card'
|
||||
import { Button } from './Button'
|
||||
|
||||
const ReloadPrompt: Component = () => {
|
||||
const {
|
||||
@@ -21,29 +25,24 @@ const ReloadPrompt: Component = () => {
|
||||
setNeedRefresh(false)
|
||||
}
|
||||
|
||||
// TODO: for now we're just going to have it be invisible
|
||||
return (<></>)
|
||||
|
||||
// return (
|
||||
// <div>
|
||||
// <Show when={offlineReady() || needRefresh()}>
|
||||
// <div>
|
||||
// <div>
|
||||
// <Show
|
||||
// fallback={<span>New content available, click on reload button to update.</span>}
|
||||
// when={offlineReady()}
|
||||
// >
|
||||
// <span>App ready to work offline</span>
|
||||
// </Show>
|
||||
// </div>
|
||||
// <Show when={needRefresh()}>
|
||||
// <button onClick={() => updateServiceWorker(true)}>Reload</button>
|
||||
// </Show>
|
||||
// <button onClick={() => close()}>Close</button>
|
||||
// </div>
|
||||
// </Show>
|
||||
// </div>
|
||||
// )
|
||||
return (
|
||||
<Show when={offlineReady() || needRefresh()}>
|
||||
<Card title="PWA settings">
|
||||
<div>
|
||||
<Show
|
||||
fallback={<span>New content available, click on reload button to update.</span>}
|
||||
when={offlineReady()}
|
||||
>
|
||||
<span>App ready to work offline</span>
|
||||
</Show>
|
||||
</div>
|
||||
<Show when={needRefresh()}>
|
||||
<Button onClick={() => updateServiceWorker(true)}>Reload</Button>
|
||||
</Show>
|
||||
<Button onClick={() => close()}>Close</Button>
|
||||
</Card>
|
||||
</Show>
|
||||
)
|
||||
}
|
||||
|
||||
export default ReloadPrompt
|
||||
Reference in New Issue
Block a user