Rewrite actions/modal and reducers/modal with typescript (#24833)

This commit is contained in:
fusagiko / takayamaki 2023-05-25 22:42:37 +09:00 committed by GitHub
parent 4197b5e4c8
commit 38c6216082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 503 additions and 261 deletions

View file

@ -143,14 +143,23 @@ class AccountGallery extends ImmutablePureComponent {
const lang = attachment.getIn(['status', 'language']);
if (attachment.get('type') === 'video') {
dispatch(openModal('VIDEO', { media: attachment, statusId, lang, options: { autoPlay: true } }));
dispatch(openModal({
modalType: 'VIDEO',
modalProps: { media: attachment, statusId, lang, options: { autoPlay: true } },
}));
} else if (attachment.get('type') === 'audio') {
dispatch(openModal('AUDIO', { media: attachment, statusId, lang, options: { autoPlay: true } }));
dispatch(openModal({
modalType: 'AUDIO',
modalProps: { media: attachment, statusId, lang, options: { autoPlay: true } },
}));
} else {
const media = attachment.getIn(['status', 'media_attachments']);
const index = media.findIndex(x => x.get('id') === attachment.get('id'));
dispatch(openModal('MEDIA', { media, index, statusId, lang }));
dispatch(openModal({
modalType: 'MEDIA',
modalProps: { media, index, statusId, lang },
}));
}
};