kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Fix scheduled statuses page crashing on delete
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>environments/review-scheduled-2x0dhb/deployments/2059
rodzic
393928a5c7
commit
ea2bb53379
|
@ -20,7 +20,12 @@ interface IScheduledStatus {
|
|||
}
|
||||
|
||||
const ScheduledStatus: React.FC<IScheduledStatus> = ({ statusId, ...other }) => {
|
||||
const status = useAppSelector((state) => buildStatus(state, state.scheduled_statuses.get(statusId)!)) as StatusEntity;
|
||||
const status = useAppSelector((state) => {
|
||||
const scheduledStatus = state.scheduled_statuses.get(statusId);
|
||||
|
||||
if (!scheduledStatus) return null;
|
||||
return buildStatus(state, scheduledStatus);
|
||||
}) as StatusEntity | null;
|
||||
|
||||
if (!status) return null;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue