calculate session files based on deltas

This commit is contained in:
Nikita Galaiko 2023-04-19 16:06:26 +02:00
parent 14bcfaa94d
commit fb41de695c

View File

@ -286,6 +286,7 @@
> >
{#each $richSessions as session} {#each $richSessions as session}
{@const isCurrent = session.id === $currentSessionId} {@const isCurrent = session.id === $currentSessionId}
{@const filesChagned = new Set(session.deltas.map(([path]) => path)).size}
<li <li
id={isCurrent ? 'current-session' : ''} id={isCurrent ? 'current-session' : ''}
class:bg-card-active={isCurrent} class:bg-card-active={isCurrent}
@ -305,8 +306,8 @@
</div> </div>
<span class="flex flex-row justify-between px-3 pb-3"> <span class="flex flex-row justify-between px-3 pb-3">
{Object.keys(session.files).length} {filesChagned}
{Object.keys(session.files).length > 1 ? 'files' : 'file'} {filesChagned !== 1 ? 'files' : 'file'}
</span> </span>
{#if isCurrent} {#if isCurrent}