R64 Fix:Portal 渲染崩溃修复

这个提交包含在:
2026-04-15 20:58:18 +08:00
父节点 7ac0de660c
当前提交 bc6e4955b3
共修改 4 个文件,包含 136 行新增和 63 行删除
+11 -8
查看文件
@@ -3,7 +3,7 @@ import { canUseWindow, isEnterpriseMessengerContainer, matchesMedia } from "./li
const MOBILE_APPROVAL_TASK_PATH = /^\/workflow\/tasks\/([^/]+)$/i;
const OFFLINE_ALLOWED_PATHS = ["/mobile/approvals"];
const RUNTIME_CACHE_NAMES = ["app-api-runtime"];
const CLEARABLE_CACHE_PREFIXES = ["app-api-runtime", "app-static-runtime", "workbox-precache"];
export function registerPwaIfEnabled() {
if (import.meta.env.DEV) {
@@ -63,12 +63,15 @@ export async function clearPwaRuntimeCaches() {
return;
}
await Promise.all(
RUNTIME_CACHE_NAMES.map(async (cacheName) => {
try {
await window.caches.delete(cacheName);
} catch {
}
}),
const cacheNames = await window.caches.keys();
const cachesToDelete = cacheNames.filter((cacheName) =>
CLEARABLE_CACHE_PREFIXES.some((prefix) => cacheName.startsWith(prefix)),
);
await Promise.all(cachesToDelete.map(async (cacheName) => {
try {
await window.caches.delete(cacheName);
} catch {
}
}));
}