Radish alpha
r
Radicle desktop app
Radicle
Git (anonymous pull)
Log in to clone via SSH
Update comment count in second column when adding comments
Rūdolfs Ošiņš committed 1 year ago
commit d86291eb79a857dc978cf91022fa0de11489cdfc
parent 84fbb1cfb224745d7cd4e5810e8e358e02406e3c
1 file changed +13 -1
modified src/views/repo/Issue.svelte
@@ -115,6 +115,12 @@
        new: { id: issue.id, body, embeds },
        opts: { announce: $announce },
      });
+
      // Update second column issue comment count without reloading the whole
+
      // issue list.
+
      const issueIndex = issues.findIndex(i => i.id === issue.id);
+
      if (issueIndex !== -1) {
+
        issues[issueIndex].commentCount += 1;
+
      }
    } catch (error) {
      console.error("Comment creation failed: ", error);
    } finally {
@@ -129,6 +135,12 @@
        new: { id: issue.id, body, embeds, replyTo },
        opts: { announce: $announce },
      });
+
      // Update second column issue comment count without reloading the whole
+
      // issue list.
+
      const issueIndex = issues.findIndex(i => i.id === issue.id);
+
      if (issueIndex !== -1) {
+
        issues[issueIndex].commentCount += 1;
+
      }
    } catch (error) {
      console.error("Comment reply creation failed", error);
    } finally {
@@ -174,7 +186,7 @@
        opts: { announce: $announce },
      });
      issue.title = updatedTitle;
-
      // Update second colum issue title without reloading the whole issue list.
+
      // Update second column issue title without reloading the whole issue list.
      const issueIndex = issues.findIndex(i => i.id === issue.id);
      if (issueIndex !== -1) {
        issues[issueIndex].title = updatedTitle;