mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-06 09:51:24 +00:00
Fix WebUI fetching deleted quote in an endless loop (#35909)
This commit is contained in:
parent
a8166d28ed
commit
3c9bde31f7
|
@ -84,12 +84,13 @@ export const QuotedStatus: React.FC<QuotedStatusProps> = ({
|
||||||
const status = useAppSelector((state) =>
|
const status = useAppSelector((state) =>
|
||||||
quotedStatusId ? state.statuses.get(quotedStatusId) : undefined,
|
quotedStatusId ? state.statuses.get(quotedStatusId) : undefined,
|
||||||
);
|
);
|
||||||
|
const isQuoteLoaded = !!status && !status.get('isLoading');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!status && quotedStatusId) {
|
if (!isQuoteLoaded && quotedStatusId) {
|
||||||
dispatch(fetchStatus(quotedStatusId));
|
dispatch(fetchStatus(quotedStatusId));
|
||||||
}
|
}
|
||||||
}, [status, quotedStatusId, dispatch]);
|
}, [isQuoteLoaded, quotedStatusId, dispatch]);
|
||||||
|
|
||||||
// In order to find out whether the quoted post should be completely hidden
|
// In order to find out whether the quoted post should be completely hidden
|
||||||
// due to a matching filter, we run it through the selector used by `status_container`.
|
// due to a matching filter, we run it through the selector used by `status_container`.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user