this repo has no description
0
fork

Configure Feed

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

Show static accounts first then the fetched accounts

+16 -7
+14 -6
src/components/generic-accounts.jsx
··· 29 29 const snapStates = useSnapshot(states); 30 30 ``; 31 31 const [uiState, setUIState] = useState('default'); 32 - const [accounts, setAccounts] = useState([]); 33 32 const [showMore, setShowMore] = useState(false); 34 33 35 34 useLocationChange(onClose); ··· 46 45 showReactions, 47 46 } = snapStates.showGenericAccounts; 48 47 48 + const [accounts, setAccounts] = useState( 49 + staticAccounts?.length ? staticAccounts : [], 50 + ); 51 + 49 52 const [relationshipsMap, setRelationshipsMap] = useState({}); 50 53 51 54 const loadRelationships = async (accounts) => { ··· 62 65 63 66 const loadAccounts = (firstLoad) => { 64 67 if (!fetchAccounts) return; 65 - if (firstLoad) setAccounts([]); 68 + if (firstLoad && !accounts?.length) setAccounts([]); 66 69 setUIState('loading'); 67 70 (async () => { 68 71 try { ··· 117 120 118 121 const firstLoad = useRef(true); 119 122 useEffect(() => { 120 - if (staticAccounts?.length > 0) { 121 - setAccounts(staticAccounts); 122 - loadRelationships(staticAccounts); 123 + if (accounts?.length > 0) { 124 + // setAccounts(staticAccounts); 125 + if (fetchAccounts) { 126 + loadAccounts(true); 127 + firstLoad.current = false; 128 + } else { 129 + loadRelationships(accounts); 130 + } 123 131 } else { 124 132 loadAccounts(true); 125 133 firstLoad.current = false; 126 134 } 127 - }, [staticAccounts, fetchAccounts]); 135 + }, [fetchAccounts]); 128 136 129 137 useEffect(() => { 130 138 if (firstLoad.current) return;
+2 -1
src/components/notification.jsx
··· 613 613 onClick={() => { 614 614 states.showGenericAccounts = { 615 615 heading: genericAccountsHeading, 616 + accounts: _accounts, 616 617 fetchAccounts: async () => { 617 618 const keyAccounts = await Promise.allSettled( 618 619 _groupKeys.map(async (gKey) => { ··· 649 650 value: accounts, 650 651 }; 651 652 }, 652 - showReactions: true, 653 + showReactions: type === 'favourite+reblog', 653 654 postID: statusKey(actualStatusID, instance), 654 655 }; 655 656 }}