Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Simplify reactOnComment action
Thomas Scholtes committed 9 months ago
commit a33799d62af33e55d9ce431e4c5b3ce91c00a8b4
parent fdabbac
5 files changed +6 -16
modified src/components/Diff.svelte
@@ -17,7 +17,6 @@
      embeds: Embed[],
    ) => Promise<void>;
    reactOnComment?: (
-
      publicKey: string,
      commentId: string,
      authors: Author[],
      reaction: string,
@@ -436,8 +435,7 @@
        inline
        rid={codeComments.rid}
        {thread}
-
        reactOnComment={codeComments.reactOnComment &&
-
          partial(codeComments.reactOnComment, codeComments.config.publicKey)}
+
        reactOnComment={codeComments.reactOnComment}
        createReply={(codeComments.canReply ?? true)
          ? async (body, embeds) => {
              await codeComments.createComment(body, embeds, thread.root.id);
modified src/components/Discussion.svelte
@@ -31,7 +31,6 @@
      embeds: Embed[],
    ) => Promise<void>;
    reactOnComment: (
-
      publicKey: string,
      commentId: string,
      authors: Author[],
      reaction: string,
@@ -149,7 +148,7 @@
        )}
        {editComment}
        createReply={createComment}
-
        reactOnComment={partial(reactOnComment, config.publicKey)} />
+
        {reactOnComment} />
      <div class="connector"></div>
    {/each}

modified src/components/Review.svelte
@@ -221,7 +221,6 @@
  }

  async function reactOnComment(
-
    publicKey: string,
    commentId: string,
    authors: Author[],
    reaction: string,
@@ -239,7 +238,7 @@
          reaction,
          review: review.id,
          active: !authors.find(
-
            ({ did }) => publicKeyFromDid(did) === publicKey,
+
            ({ did }) => publicKeyFromDid(did) === config.publicKey,
          ),
        },
        opts: { announce: $nodeRunning && $announce },
modified src/components/Revision.svelte
@@ -129,7 +129,6 @@
  }

  async function reactOnComment(
-
    publicKey: string,
    commentId: string,
    authors: Author[],
    reaction: string,
@@ -144,7 +143,7 @@
          reaction,
          revision: revision.id,
          active: !authors.find(
-
            ({ did }) => publicKeyFromDid(did) === publicKey,
+
            ({ did }) => publicKeyFromDid(did) === config.publicKey,
          ),
        },
        opts: { announce: $nodeRunning && $announce },
modified src/views/repo/Issue.svelte
@@ -230,7 +230,6 @@
  }

  async function reactOnComment(
-
    publicKey: string,
    commentId: string,
    authors: Author[],
    reaction: string,
@@ -244,7 +243,7 @@
          id: commentId,
          reaction,
          active: !authors.find(
-
            ({ did }) => publicKeyFromDid(did) === publicKey,
+
            ({ did }) => publicKeyFromDid(did) === config.publicKey,
          ),
        },
        opts: { announce: $nodeRunning && $announce },
@@ -456,11 +455,7 @@
          repo.delegates.map(delegate => delegate.did),
          issue.body.author.did,
        ) && partial(editComment, issue.body.id)}
-
        reactOnComment={partial(
-
          reactOnComment,
-
          config.publicKey,
-
          issue.body.id,
-
        )}>
+
        reactOnComment={partial(reactOnComment, issue.body.id)}>
      </CommentComponent>
    </div>