[FIX] Fix crash when deleting scheduled post (#112)
This commit is contained in:
parent
67a83a8f56
commit
5c5f42dcaa
|
@ -14,9 +14,12 @@ export const buildStatus = (state: RootState, scheduledStatus: ScheduledStatus)
|
|||
|
||||
const account = getAccount(state, me);
|
||||
|
||||
if (!scheduledStatus) return null;
|
||||
|
||||
const status = ImmutableMap({
|
||||
account,
|
||||
content: scheduledStatus.text.replace(new RegExp('\n', 'g'), '<br>'), /* eslint-disable-line no-control-regex */
|
||||
// eslint-disable-next-line no-control-regex
|
||||
content: scheduledStatus.text.replace(new RegExp('\n', 'g'), '<br>'),
|
||||
created_at: scheduledStatus.scheduled_at,
|
||||
id: scheduledStatus.id,
|
||||
in_reply_to_id: scheduledStatus.in_reply_to_id,
|
||||
|
|
|
@ -20,7 +20,7 @@ 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) => buildStatus(state, state.scheduled_statuses.get(statusId))) as StatusEntity;
|
||||
|
||||
if (!status) return null;
|
||||
|
||||
|
|
Loading…
Reference in a new issue