mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-15 11:20:36 +08:00
Narrow down IssueOp type by flattening it
This commit is contained in:
+13
-14
@@ -2,7 +2,7 @@
|
||||
import type { Config } from "@bindings/Config";
|
||||
import type { Issue } from "@bindings/Issue";
|
||||
import type { RepoInfo } from "@bindings/RepoInfo";
|
||||
import type { IssueOps } from "@bindings/IssueOps";
|
||||
import type { IssueOp } from "@bindings/IssueOp";
|
||||
|
||||
import capitalize from "lodash/capitalize";
|
||||
|
||||
@@ -221,32 +221,31 @@
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
{#await invoke<IssueOps[]>( "activity_by_id", { rid: repo.rid, typeName: "xyz.radicle.issue", id: issue.id }, ) then activity}
|
||||
{#each activity.slice(1) as { action, timestamp, author }}
|
||||
{#if action.type === "lifecycle"}
|
||||
{#await invoke<IssueOp[]>( "activity_by_id", { rid: repo.rid, typeName: "xyz.radicle.issue", id: issue.id }, ) then activity}
|
||||
{#each activity.slice(1) as op}
|
||||
{#if op.type === "lifecycle"}
|
||||
<div class="txt-small body">
|
||||
<div class="global-flex txt-small">
|
||||
<NodeId {...authorForNodeId(author)} />
|
||||
alias={author.alias} /> change of status to {action.state
|
||||
.status}
|
||||
<NodeId {...authorForNodeId(op.author)} />
|
||||
alias={op.author.alias} /> change of status to {op.state.status}
|
||||
<!-- <div class="global-oid"></div> -->
|
||||
{formatTimestamp(timestamp)}
|
||||
{formatTimestamp(op.timestamp)}
|
||||
</div>
|
||||
</div>
|
||||
{:else if action.type === "comment"}
|
||||
{:else if op.type === "comment"}
|
||||
<div class="txt-small body">
|
||||
<Markdown rid={repo.rid} breaks content={action.body} />
|
||||
<Markdown rid={repo.rid} breaks content={op.body} />
|
||||
<div class="global-flex txt-small" style:margin-top="1.5rem">
|
||||
<NodeId {...authorForNodeId(author)} />
|
||||
{#if action.replyTo}
|
||||
<NodeId {...authorForNodeId(op.author)} />
|
||||
{#if op.replyTo}
|
||||
replied to <div class="global-oid">
|
||||
{formatOid(action.replyTo)}
|
||||
{formatOid(op.replyTo)}
|
||||
</div>
|
||||
{:else}
|
||||
commented
|
||||
{/if}
|
||||
<!-- <div class="global-oid"></div> -->
|
||||
{formatTimestamp(timestamp)}
|
||||
{formatTimestamp(op.timestamp)}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user