mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-29 00:10:47 +08:00
Update comment count in second column when adding comments
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user