File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/user/dashboard/news-feed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments