Fix scheduled statuses page crashing on delete
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
393928a5c7
commit
ea2bb53379
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue