mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 08:40:52 +08:00
Set Revision expanded state only on first mount
Instead of recalculating the expanded state of a revision on any `patch.revisions` variable change, we should just use it once on Mount and then let the `Revision` component manage their expanded state internally.
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
import Thread from "@app/components/Thread.svelte";
|
||||
|
||||
export let baseUrl: BaseUrl;
|
||||
export let expanded: boolean = false;
|
||||
export let initialExpanded: boolean = false;
|
||||
export let rawPath: (commit?: string) => string;
|
||||
export let patchId: string;
|
||||
export let patchState: PatchState;
|
||||
@@ -64,6 +64,7 @@
|
||||
| ((commentId: string, comment: string, embeds: Embed[]) => Promise<void>)
|
||||
| undefined;
|
||||
|
||||
let expanded = initialExpanded;
|
||||
const api = new HttpdClient(baseUrl);
|
||||
const latestEdit = revisionEdits.pop();
|
||||
|
||||
|
||||
@@ -888,7 +888,7 @@
|
||||
partial(createReply, session.id, revision.revisionId)}
|
||||
patchId={patch.id}
|
||||
patchState={patch.state}
|
||||
expanded={index === patch.revisions.length - 1}
|
||||
initialExpanded={index === patch.revisions.length - 1}
|
||||
previousRevId={previousRevision?.id}
|
||||
previousRevOid={previousRevision?.oid}>
|
||||
{#if index === patch.revisions.length - 1}
|
||||
|
||||
Reference in New Issue
Block a user