Compare commits

...

1 commit

Author SHA1 Message Date
clovis da79aeb5cb [FIX] Fix crash when deleting scheduled post 2022-12-21 23:20:19 +01:00
2 changed files with 5 additions and 2 deletions

View file

@ -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,

View file

@ -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;