mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 20:01:56 +03:00
Merge branch 'nt/no-user-crash' into nt/pin-from-feed
This commit is contained in:
commit
9d5c752802
@ -47,9 +47,12 @@ const TabContent = ({
|
||||
const isAnalytics = useSelector((state) => state.application.isAnalytics);
|
||||
const nsfw = useSelector((state) => state.application.nsfw);
|
||||
const isConnected = useSelector((state) => state.application.isConnected);
|
||||
const {name:username, about:{profile:{pinned}}} = useSelector((state) => state.account.currentAccount);
|
||||
const currentAccount = useSelector((state) => state.account.currentAccount);
|
||||
const initPosts = useSelector((state) => state.posts.initPosts)
|
||||
|
||||
const username = currentAccount.username;
|
||||
const curPinned = currentAccount.about?.pinned;
|
||||
|
||||
|
||||
//state
|
||||
const [posts, setPosts] = useState([]);
|
||||
@ -72,6 +75,8 @@ const TabContent = ({
|
||||
sessionUserRef.current = sessionUser;
|
||||
|
||||
|
||||
|
||||
|
||||
//side effects
|
||||
useEffect(() => {
|
||||
|
||||
@ -101,13 +106,11 @@ const TabContent = ({
|
||||
}, [filterScrollRequest])
|
||||
|
||||
useEffect(()=>{
|
||||
if(pageType === 'ownProfile' && pinned !== pinnedPermlink ){
|
||||
// setPinnedPermlink(pinnedPermlink)
|
||||
// alert("This is called")
|
||||
if(pageType === 'ownProfile' && curPinned !== pinnedPermlink ){
|
||||
_scrollToTop();
|
||||
_loadPosts({shouldReset:true, _pinnedPermlink:pinned})
|
||||
_loadPosts({shouldReset:true, _pinnedPermlink:curPinned})
|
||||
}
|
||||
},[pinned])
|
||||
},[curPinned])
|
||||
|
||||
|
||||
const _cleanup = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user