fix: scope mobile share install to dashboard path (#223)
This commit is contained in:
1 parent
4499a7f947
commit
a25b547d20
5 files changed
+20
-11
No files matched your search
+1
-1
@@ -3067,7 +3067,7 @@ textarea { resize: vertical; min-height: 120px; }
|
||||
if (workSession.active()) workSession.reconcile();
|
||||
});
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/service-worker.js').catch(error =>
|
||||
navigator.serviceWorker.register('service-worker.js').catch(error =>
|
||||
console.warn('Stackchain install support unavailable', error)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
"name": "Stackchain Dashboard",
|
||||
"short_name": "Stackchain",
|
||||
"description": "Capture, plan, and complete Gitea work from mobile.",
|
||||
"id": "/",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"id": "./",
|
||||
"start_url": "./",
|
||||
"scope": "./",
|
||||
"display": "standalone",
|
||||
"background_color": "#07111f",
|
||||
"theme_color": "#0b1220",
|
||||
"icons": [
|
||||
{"src": "/static/icons/stackchain-192.png", "sizes": "192x192", "type": "image/png"},
|
||||
{"src": "/static/icons/stackchain-512.png", "sizes": "512x512", "type": "image/png"}
|
||||
{"src": "static/icons/stackchain-192.png", "sizes": "192x192", "type": "image/png"},
|
||||
{"src": "static/icons/stackchain-512.png", "sizes": "512x512", "type": "image/png"}
|
||||
],
|
||||
"share_target": {
|
||||
"action": "/",
|
||||
"action": "./",
|
||||
"method": "GET",
|
||||
"enctype": "application/x-www-form-urlencoded",
|
||||
"params": {"title": "title", "text": "text", "url": "url"}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
const CACHE = 'stackchain-shell-v1';
|
||||
const SHELL = ['/manifest.webmanifest', '/static/icons/stackchain-192.png', '/static/icons/stackchain-512.png'];
|
||||
const BASE = new URL('./', self.location.href).pathname;
|
||||
const SHELL = [
|
||||
BASE + 'manifest.webmanifest',
|
||||
BASE + 'static/icons/stackchain-192.png',
|
||||
BASE + 'static/icons/stackchain-512.png',
|
||||
];
|
||||
|
||||
self.addEventListener('install', event => {
|
||||
event.waitUntil(caches.open(CACHE).then(cache => cache.addAll(SHELL)).then(() => self.skipWaiting()));
|
||||
|
||||
Reference in new issue
Block a user