Alex Gleason 2021-07-08 19:30:02 -05:00
rodzic 391d4158af
commit bc7f72a691
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 18 dodań i 1 usunięć

Wyświetl plik

@ -64,6 +64,22 @@ export function importFetchedStatus(status) {
return importFetchedStatuses([status]);
}
// Sometimes Pleroma can return an empty account,
// or a repost can appear of a deleted account. Skip these statuses.
const isBroken = status => {
try {
// Skip empty accounts
// https://gitlab.com/soapbox-pub/soapbox-fe/-/issues/424
if (!status.account.id) return true;
// Skip broken reposts
// https://gitlab.com/soapbox-pub/soapbox/-/issues/28
if (status.reblog && !status.reblog.account.id) return true;
return false;
} catch(e) {
return true;
}
};
export function importFetchedStatuses(statuses) {
return (dispatch, getState) => {
const accounts = [];
@ -71,7 +87,8 @@ export function importFetchedStatuses(statuses) {
const polls = [];
function processStatus(status) {
if (!status.account.id) return;
// Skip broken statuses
if (isBroken(status)) return;
const normalOldStatus = getState().getIn(['statuses', status.id]);
const expandSpoilers = getSettings(getState()).get('expandSpoilers');