From 847426a507c875f3f660c2ffaa9feb3a510854a1 Mon Sep 17 00:00:00 2001 From: Tim <135014430+nagisa77@users.noreply.github.com> Date: Fri, 1 Aug 2025 12:09:10 +0800 Subject: [PATCH] feat(frontend): expand first-level comments by default --- open-isle-cli/src/views/PostPageView.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/open-isle-cli/src/views/PostPageView.vue b/open-isle-cli/src/views/PostPageView.vue index 470d2f698..311383bcf 100644 --- a/open-isle-cli/src/views/PostPageView.vue +++ b/open-isle-cli/src/views/PostPageView.vue @@ -216,15 +216,15 @@ export default { } } - const mapComment = c => ({ + const mapComment = (c, level = 0) => ({ id: c.id, userName: c.author.username, time: TimeManager.format(c.createdAt), avatar: c.author.avatar, text: c.content, reactions: c.reactions || [], - reply: (c.replies || []).map(mapComment), - openReplies: false, + reply: (c.replies || []).map(r => mapComment(r, level + 1)), + openReplies: level === 0, src: c.author.avatar, iconClick: () => router.push(`/users/${c.author.id}`) })