fix: sync post translation state and clear feed cache on language change
This commit is contained in:
@@ -23,6 +23,11 @@ let Post = (props) => {
|
||||
const viewer = gState.me;
|
||||
let [showCommentsB, changeshowCommentsB] = useState(props.showComments || false);
|
||||
let [post, changePost] = useState(props.post);
|
||||
|
||||
React.useEffect(() => {
|
||||
changePost(props.post);
|
||||
}, [props.post]);
|
||||
|
||||
const [deleted, setDeleted] = useState(false);
|
||||
let [likes, changeLikes] = useState(Object.keys(post.reactions).length);
|
||||
let [bookmarked, changeBookmarked] = useState(post.bookmarks && post.bookmarks.includes(viewer._id));
|
||||
|
||||
Reference in New Issue
Block a user