mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fixed #158
This commit is contained in:
@@ -128,7 +128,9 @@ const ComposeEditAttachmentImage: React.FC<Props> = ({ index }) => {
|
||||
height: imageDimensionis.height
|
||||
}}
|
||||
source={{
|
||||
uri: theAttachmentLocal?.uri || theAttachmentRemote?.preview_url
|
||||
uri: theAttachmentLocal?.path
|
||||
? `file://${theAttachmentLocal?.path}`
|
||||
: theAttachmentRemote?.preview_url
|
||||
}}
|
||||
/>
|
||||
<PanGestureHandler onGestureEvent={onGestureEvent}>
|
||||
|
@@ -34,7 +34,7 @@ const ComposeEditAttachmentRoot: React.FC<Props> = ({ index }) => {
|
||||
video={
|
||||
video.local
|
||||
? ({
|
||||
url: video.local.uri,
|
||||
url: `file://${video.local.path}`,
|
||||
preview_url: video.local.local_thumbnail,
|
||||
blurhash: video.remote?.blurhash
|
||||
} as Mastodon.AttachmentVideo)
|
||||
|
@@ -58,7 +58,7 @@ const composeReducer = (
|
||||
attachments: {
|
||||
...state.attachments,
|
||||
uploads: state.attachments.uploads.map(upload =>
|
||||
upload.local?.uri === action.payload.local?.uri
|
||||
upload.local?.path === action.payload.local?.path
|
||||
? { ...upload, remote: action.payload.remote, uploading: false }
|
||||
: upload
|
||||
)
|
||||
|
7
src/screens/Compose/utils/types.d.ts
vendored
7
src/screens/Compose/utils/types.d.ts
vendored
@@ -2,7 +2,7 @@ import { ImageOrVideo } from 'react-native-image-crop-picker'
|
||||
|
||||
export type ExtendedAttachment = {
|
||||
remote?: Mastodon.Attachment
|
||||
local?: Pick<ImageOrVideo, 'path' | 'width' | 'height'> & {
|
||||
local?: Pick<ImageOrVideo, 'path' | 'width' | 'height' | 'mime'> & {
|
||||
type: 'image' | 'video' | 'unknown'
|
||||
local_thumbnail?: string
|
||||
hash?: string
|
||||
@@ -121,7 +121,10 @@ export type ComposeAction =
|
||||
}
|
||||
| {
|
||||
type: 'attachment/upload/end'
|
||||
payload: { remote: Mastodon.Attachment; local: ImageInfo }
|
||||
payload: {
|
||||
remote: Mastodon.Attachment
|
||||
local: Pick<ImageOrVideo, 'path' | 'width' | 'height' | 'mime'>
|
||||
}
|
||||
}
|
||||
| {
|
||||
type: 'attachment/upload/fail'
|
||||
|
Reference in New Issue
Block a user