Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
🐞 Fixed

- Fixed `.replaceMentions` not escaping special characters in the username.
- Fixed videos not being saved to gallery correctly on mobile
platforms. [[#2357]](https://github.com/GetStream/stream-chat-flutter/issues/2357)

## 9.16.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,19 @@ class StreamAttachmentHandler extends StreamAttachmentHandlerBase {

// Now that the file is saved, we need to copy it to the user's gallery
// because the gallery only shows files that are in the gallery folder.
await Gal.putImage(path);
final copyToGallery = switch (file.mimeType) {
final type? when type.startsWith('image/') => Gal.putImage,
final type? when type.startsWith('video/') => Gal.putVideo,
_ => null,
};

// Once the file is copied to the gallery, we can delete the temporary file.
await file.delete();
if (copyToGallery != null) {
await copyToGallery.call(path);

// If the file was successfully copied to the gallery, we can safely
// delete the temporary file.
await file.delete();
}

return path;
}
Expand Down