0.2.37: live funds above exited ones in the investor portal
A fully-exited fund/SPV card sinks to the bottom of the LP's stack instead of sitting between active funds (stable sort, shared by the LP portal and the admin Investor View). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
1deb6586b0
commit
053bfeab23
@@ -3,7 +3,7 @@
|
||||
// - 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.36'
|
||||
const CACHE = 'ten31-portal-0.2.37'
|
||||
|
||||
self.addEventListener('install', () => self.skipWaiting())
|
||||
|
||||
|
||||
@@ -35,6 +35,14 @@ export default function InvestorPortalView({
|
||||
accounts.filter((a) => a.exited_on).map((a) => `${a.entity_id}:${a.investor_user_id}`),
|
||||
).size;
|
||||
|
||||
// Live funds first; a fund where every position is exited sinks to the bottom so closed
|
||||
// positions never sit between active ones. Stable sort keeps the original order otherwise.
|
||||
const isClosed = (e: Entity) => {
|
||||
const own = accounts.filter((a) => a.entity_id === e.id);
|
||||
return own.length > 0 && own.every((a) => a.exited_on);
|
||||
};
|
||||
const ordered = [...entities].sort((a, b) => Number(isClosed(a)) - Number(isClosed(b)));
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
{activeEntityCount > 1 && (
|
||||
@@ -44,7 +52,7 @@ export default function InvestorPortalView({
|
||||
exitedCount={exitedPositions}
|
||||
/>
|
||||
)}
|
||||
{entities.map((e) => (
|
||||
{ordered.map((e) => (
|
||||
<FundSection
|
||||
key={e.id}
|
||||
entity={e}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Bumped each release so the running build is visible in the UI.
|
||||
// If the number shown in the app doesn't match the installed s9pk version,
|
||||
// the new frontend isn't actually being served.
|
||||
export const APP_VERSION = "0.2.36";
|
||||
export const APP_VERSION = "0.2.37";
|
||||
|
||||
Reference in New Issue
Block a user