Update Healer Man server

This commit is contained in:
phenom committed 2026-10-04 13:13:35 -04:00
1 parent 39458d5de6
commit 6cc1b9217f
203 files changed
+133929 -31271

No files matched your search

+9 -1
View File
@@ -78,6 +78,7 @@ let initialization: Promise<void> | null = null;
let installedStorageValidation: Promise<void> | null = null;
let installedStorageValidationComplete = Object.keys(installedState.packs).length === 0;
const validatedInstalledFiles = new Set<string>();
const usablePackCache = new Map<string, boolean>();
function safeLocalStorage(): Storage | null {
try { return typeof window === "undefined" ? null : window.localStorage; } catch { return null; }
@@ -148,6 +149,9 @@ function persistInstalledState(): void {
}
function publish(patch: Partial<Omit<ContentManagerSnapshot, "revision">>): void {
// Every receipt/storage/manifest change publishes before notifying consumers.
// Cache both usable and unavailable packs until the next content revision.
usablePackCache.clear();
snapshot = { ...snapshot, ...patch, revision: snapshot.revision + 1 };
listeners.forEach((listener) => listener());
}
@@ -364,7 +368,11 @@ function contentPackIsUsableInternal(packId: string, visiting: ReadonlySet<strin
}
export function contentPackIsUsable(packId: string): boolean {
return contentPackIsUsableInternal(packId, new Set());
const cached = usablePackCache.get(packId);
if (cached !== undefined) return cached;
const usable = contentPackIsUsableInternal(packId, new Set());
usablePackCache.set(packId, usable);
return usable;
}
/** Vite serves the complete source asset tree in development; shipped builds require an installed pack. */