Changeset View
Changeset View
Standalone View
Standalone View
native/media/image-modal.react.js
Show First 20 Lines • Show All 1,136 Lines • ▼ Show 20 Lines | class ImageModal extends React.PureComponent<Props, State> { | ||||
} | } | ||||
close = () => { | close = () => { | ||||
this.props.navigation.goBackOnce(); | this.props.navigation.goBackOnce(); | ||||
}; | }; | ||||
save = () => { | save = () => { | ||||
const { mediaInfo, item } = this.props.route.params; | const { mediaInfo, item } = this.props.route.params; | ||||
invariant( | |||||
mediaInfo.type === 'photo' || mediaInfo.type === 'video', | |||||
'saving media of type ' + mediaInfo.type + ' is not supported', | |||||
); | |||||
const { id: uploadID, uri } = mediaInfo; | const { id: uploadID, uri } = mediaInfo; | ||||
const { id: messageServerID, localID: messageLocalID } = item.messageInfo; | const { id: messageServerID, localID: messageLocalID } = item.messageInfo; | ||||
const ids = { uploadID, messageServerID, messageLocalID }; | const ids = { uploadID, messageServerID, messageLocalID }; | ||||
return this.props.intentionalSaveMedia(uri, ids); | return this.props.intentionalSaveMedia(uri, ids); | ||||
}; | }; | ||||
copy = () => { | copy = () => { | ||||
const { uri } = this.props.route.params.mediaInfo; | const { uri } = this.props.route.params.mediaInfo; | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |