feat: complete application updates
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "نادمی تکس",
|
||||
"short_name": "نادمی تکس",
|
||||
"description": "سامانه سفارش عمده پارچه",
|
||||
"lang": "fa",
|
||||
"dir": "rtl",
|
||||
"start_url": "./",
|
||||
"display": "standalone",
|
||||
"background_color": "#f5f0ed",
|
||||
"theme_color": "#081d39",
|
||||
"icons": [
|
||||
{
|
||||
"src": "icon-192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
},
|
||||
{
|
||||
"src": "icon-512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
const CACHE_NAME = 'nademitex-user-v1'
|
||||
|
||||
self.addEventListener('install', () => {
|
||||
self.skipWaiting()
|
||||
})
|
||||
|
||||
self.addEventListener('activate', (event) => {
|
||||
event.waitUntil(self.clients.claim())
|
||||
})
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
if (event.request.method !== 'GET') return
|
||||
|
||||
const url = new URL(event.request.url)
|
||||
if (url.origin !== self.location.origin || url.pathname.includes('/server/api')) return
|
||||
|
||||
event.respondWith(
|
||||
fetch(event.request)
|
||||
.then((response) => {
|
||||
const copy = response.clone()
|
||||
caches.open(CACHE_NAME).then((cache) => cache.put(event.request, copy))
|
||||
return response
|
||||
})
|
||||
.catch(() => caches.match(event.request)),
|
||||
)
|
||||
})
|
||||