diff --git a/src/devhub/entity/post/List.jsx b/src/devhub/entity/post/List.jsx index 04007c4ed..cece362dd 100644 --- a/src/devhub/entity/post/List.jsx +++ b/src/devhub/entity/post/List.jsx @@ -61,14 +61,13 @@ function updateSearchCondition() { }); } -function getPostIds() { +function getPostIds(tag) { if (searchConditionChanged()) { updateSearchCondition(); - return; } let where = {}; let authorId = props.author; - let label = props.tag; + let label = tag || props.tag; if (authorId) { where = { author_id: { _eq: authorId }, ...where }; } @@ -141,7 +140,9 @@ State.init({ period: "week", }); -getPostIds(); +if (!state.items || searchConditionChanged()) { + getPostIds(); +} function defaultRenderItem(postId, additionalProps) { if (!additionalProps) { @@ -162,6 +163,12 @@ function defaultRenderItem(postId, additionalProps) { onDraftStateChange, ...additionalProps, referral: postId, + updateTagInParent: (tag) => { + if (typeof props.updateTagInput === "function") { + props.updateTagInput(tag); + } + getPostIds(tag); + }, }} /> diff --git a/src/devhub/entity/post/Post.jsx b/src/devhub/entity/post/Post.jsx index 2b42d6d7c..1f988fd29 100644 --- a/src/devhub/entity/post/Post.jsx +++ b/src/devhub/entity/post/Post.jsx @@ -646,11 +646,16 @@ const tags = post.snapshot.labels ? (