fix: get pwa working

This commit is contained in:
vilm3r
2022-06-23 10:44:10 -05:00
parent 61ed15c4f5
commit 6136599cac
6 changed files with 10 additions and 6 deletions

3
.gitignore vendored
View File

@@ -23,3 +23,6 @@
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
# pwa/workbox
/public/*.js

View File

@@ -1,10 +1,11 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const withPWA = require('next-pwa') const withPWA = require('next-pwa')
const runtimeCaching = require('next-pwa/cache')
module.exports = withPWA({ module.exports = withPWA({
pwa: { pwa: {
dest: 'public', dest: 'public',
runtimeCaching, register: true,
skipWaiting: true,
disable: process.env.NODE_ENV === "development",
}, },
}) })

View File

@@ -14,9 +14,9 @@
} }
], ],
"start_url": "/", "start_url": "/",
"background_color": "#3367D6", "background_color": "#4D6A51",
"display": "standalone", "display": "standalone",
"scope": "/", "scope": "/",
"theme_color": "#3367D6", "theme_color": "#3C3744",
"description": "Sendstr is an open source end-to-end encrypted shared clipboard app built on top of Nostr. No login needed, new throwaway encryption keys are generated on page load." "description": "Sendstr is an open source end-to-end encrypted shared clipboard app built on top of Nostr. No login needed, new throwaway encryption keys are generated on page load."
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -66,6 +66,8 @@ export default function Home({ nostr, event }: HomeProps) {
page load, and the default relay deletes messages after 1 hour." page load, and the default relay deletes messages after 1 hour."
/> />
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<link rel="manifest" href="/manifest.json" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png"></link>
</Head> </Head>
<div className="bg-custom-green-dark min-h-screen"> <div className="bg-custom-green-dark min-h-screen">
<div className="p-5"> <div className="p-5">