mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-21 21:29:20 +01:00
Fix account info not re-rendering correctly when id changed
This commit is contained in:
parent
35e34c0bc6
commit
ffc216cfed
1 changed files with 9 additions and 14 deletions
|
@ -259,27 +259,21 @@ function AccountStatuses() {
|
||||||
|
|
||||||
const { displayName, acct, emojis } = account || {};
|
const { displayName, acct, emojis } = account || {};
|
||||||
|
|
||||||
const accountInfoMemo = useMemo(() => {
|
|
||||||
const cachedAccount = snapStates.accounts[`${id}@${instance}`];
|
|
||||||
return (
|
|
||||||
<AccountInfo
|
|
||||||
instance={instance}
|
|
||||||
account={cachedAccount || id}
|
|
||||||
fetchAccount={fetchAccount}
|
|
||||||
authenticated={authenticated}
|
|
||||||
standalone
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}, [id, instance, authenticated, fetchAccount]);
|
|
||||||
|
|
||||||
const filterBarRef = useRef();
|
const filterBarRef = useRef();
|
||||||
const TimelineStart = useMemo(() => {
|
const TimelineStart = useMemo(() => {
|
||||||
const filtered =
|
const filtered =
|
||||||
!excludeReplies || excludeBoosts || tagged || media || !!month;
|
!excludeReplies || excludeBoosts || tagged || media || !!month;
|
||||||
|
const cachedAccount = snapStates.accounts[`${id}@${instance}`];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{accountInfoMemo}
|
<AccountInfo
|
||||||
|
instance={instance}
|
||||||
|
account={cachedAccount || id}
|
||||||
|
fetchAccount={fetchAccount}
|
||||||
|
authenticated={authenticated}
|
||||||
|
standalone
|
||||||
|
/>
|
||||||
<div
|
<div
|
||||||
class="filter-bar"
|
class="filter-bar"
|
||||||
ref={filterBarRef}
|
ref={filterBarRef}
|
||||||
|
@ -418,6 +412,7 @@ function AccountStatuses() {
|
||||||
instance,
|
instance,
|
||||||
authenticated,
|
authenticated,
|
||||||
featuredTags,
|
featuredTags,
|
||||||
|
fetchAccount,
|
||||||
searchEnabled,
|
searchEnabled,
|
||||||
...allSearchParams,
|
...allSearchParams,
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue