fix(config): phase 7 follow-up — fix remaining /ims/ occurrences in sw.js, notifications, components

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 22:32:11 +08:00
co-authored by Claude Sonnet 4.6
parent 9d047e168f
commit 0389d6091a
12 changed files with 21 additions and 21 deletions
+4 -4
View File
@@ -16,20 +16,20 @@ self.addEventListener('activate', event => {
self.addEventListener('fetch', event => {
const url = new URL(event.request.url)
// Only handle same-origin GET requests under /ims/
// Only handle same-origin GET requests
if (
event.request.method !== 'GET' ||
url.origin !== self.location.origin ||
!url.pathname.startsWith('/ims/')
!url.pathname.startsWith('/')
) {
return
}
// Skip API routes — always go to network
if (url.pathname.startsWith('/ims/api/')) return
if (url.pathname.startsWith('/api/')) return
// Cache-first for immutable Next.js static assets
if (url.pathname.startsWith('/ims/_next/static/')) {
if (url.pathname.startsWith('/_next/static/')) {
event.respondWith(
caches.match(event.request).then(cached => {
if (cached) return cached