this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

If self, don't need to get familiar followers

+8 -1
+8 -1
src/components/account-info.jsx
··· 1 1 import './account-info.css'; 2 2 3 3 import { Menu, MenuDivider, MenuItem, SubMenu } from '@szhsin/react-menu'; 4 - import { useEffect, useReducer, useRef, useState } from 'preact/hooks'; 4 + import { useEffect, useMemo, useReducer, useRef, useState } from 'preact/hooks'; 5 5 6 6 import { api } from '../utils/api'; 7 7 import enhanceContent from '../utils/enhance-content'; ··· 61 61 const [uiState, setUIState] = useState('default'); 62 62 const isString = typeof account === 'string'; 63 63 const [info, setInfo] = useState(isString ? null : account); 64 + 65 + const isSelf = useMemo( 66 + () => account.id === store.session.get('currentAccount'), 67 + [account?.id], 68 + ); 64 69 65 70 useEffect(() => { 66 71 if (!isString) { ··· 128 133 }); 129 134 } 130 135 const results = await followersIterator.current.next(); 136 + if (isSelf) return results; 137 + 131 138 const { value } = results; 132 139 let newValue = []; 133 140 // On first load, fetch familiar followers, merge to top of results' `value`