Skip to content

Commit de8adc4

Browse files
Requested changes
1 parent c9e6e18 commit de8adc4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/user/dashboard/news-feed/news-feed.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,14 @@ function NewsFeed(props) {
154154
const [deletePostId, setDeletePostId] = useState("");
155155
const [shareableContent, setSharableContent] = useState("");
156156

157+
const FILTER_TAGS_REGEX = new RegExp(/(<([^>]+)>)/gi);
158+
157159
useEffect(() => {
158-
console.log("useEffect from news-feed ", props);
159-
setEvents(props?.allEvents);
160-
setAllProjects(props?.allProjects);
161-
setAllPosts(props?.allPosts);
160+
const { allEvents, allProjects, allPosts } = props;
161+
162+
setEvents(allEvents);
163+
setAllProjects(allProjects);
164+
setAllPosts(allPosts);
162165
}, [
163166
props.allEvents,
164167
props.allPosts,
@@ -351,7 +354,7 @@ function NewsFeed(props) {
351354
eventKey="2"
352355
onClick={() =>
353356
showSharePostModal(
354-
post?.content.replace(/(<([^>]+)>)/gi, "")
357+
post?.content.replace(FILTER_TAGS_REGEX, "")
355358
)
356359
}
357360
>

0 commit comments

Comments
 (0)