Cumulative checkpoint since 0.2.26:
- 0.2.27/28: entity valuation-history table; investor gain/loss = NAV +
distributions vs paid-in
- 0.2.29: Reset Fund Partners (endpoint, Partners-tab button, CLI, action)
- 0.2.30: "Current Capital Balance" label, %-only gain/loss
- 0.2.31: Management Entities rename, Carry Vehicle type, chart
distributions-line gate
- 0.2.32: LP-facing polish pass
* Ten31 brand palette from the logo (navy/mint); orange retired
* portfolio summary card across funds; gain labeled "net of paid-in"
* whole-dollar headline figures; "History · N quarters" toggle
* documents grouped by year with a "New" badge (users.docs_seen_at)
* eNAV-created members start on default password with login enabled;
enable-investor-logins CLI + StartOS action for existing accounts
* password minimum raised to 8 chars; login help line (Portal@ten31.xyz)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
57 lines
1.7 KiB
JavaScript
57 lines
1.7 KiB
JavaScript
// Ten31 Portal service worker. Deliberately conservative so it never serves a stale app:
|
|
// - navigations are network-first (always get the latest index.html), cache only as offline fallback
|
|
// - content-hashed /assets/* are cache-first (immutable, safe forever)
|
|
// - /api/* is never cached
|
|
// Bump CACHE on each release so old entries are purged.
|
|
const CACHE = 'ten31-portal-0.2.32'
|
|
|
|
self.addEventListener('install', () => self.skipWaiting())
|
|
|
|
self.addEventListener('activate', (event) => {
|
|
event.waitUntil(
|
|
(async () => {
|
|
const keys = await caches.keys()
|
|
await Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))
|
|
await self.clients.claim()
|
|
})(),
|
|
)
|
|
})
|
|
|
|
self.addEventListener('fetch', (event) => {
|
|
const req = event.request
|
|
if (req.method !== 'GET') return
|
|
const url = new URL(req.url)
|
|
if (url.origin !== self.location.origin) return
|
|
if (url.pathname.startsWith('/api/')) return
|
|
|
|
if (req.mode === 'navigate') {
|
|
event.respondWith(
|
|
(async () => {
|
|
try {
|
|
const fresh = await fetch(req)
|
|
const cache = await caches.open(CACHE)
|
|
cache.put('/', fresh.clone())
|
|
return fresh
|
|
} catch {
|
|
const cache = await caches.open(CACHE)
|
|
return (await cache.match('/')) || Response.error()
|
|
}
|
|
})(),
|
|
)
|
|
return
|
|
}
|
|
|
|
if (url.pathname.startsWith('/assets/')) {
|
|
event.respondWith(
|
|
(async () => {
|
|
const cache = await caches.open(CACHE)
|
|
const hit = await cache.match(req)
|
|
if (hit) return hit
|
|
const res = await fetch(req)
|
|
if (res.ok) cache.put(req, res.clone())
|
|
return res
|
|
})(),
|
|
)
|
|
}
|
|
})
|