Fix iOS share extension large image handling
- Fix large images not loading from share sheet (exceeded UserDefaults 4MB limit) - Store all shared images as files in App Group container instead of base64 in UserDefaults - Fix image refresh when sharing new image while already on SharedPhotoView - Add route query watcher to detect _refresh parameter changes - Remove debug logging and redundant UIImage check The previous implementation tried to store base64-encoded images in UserDefaults, which failed for large images (HEIF images were often 6MB+ when base64 encoded). Now all images are stored as files in the App Group container, with only the file path stored in UserDefaults. This supports images of any size and provides consistent behavior regardless of format. Also fixes an issue where sharing a new image while already viewing SharedPhotoView wouldn't refresh the displayed image.
This commit is contained in:
@@ -196,13 +196,14 @@ export default class SharedPhotoView extends Vue {
|
||||
|
||||
/**
|
||||
* Watches for route query changes to reload image when navigating
|
||||
* to the same route with different query parameters (e.g., new fileName)
|
||||
* to the same route with different query parameters (e.g., new fileName or _refresh)
|
||||
* This handles both new navigations and refreshes when already on the route
|
||||
*/
|
||||
@Watch("$route.query.fileName")
|
||||
async onFileNameChange(newFileName: string | undefined) {
|
||||
if (newFileName) {
|
||||
await this.loadSharedImage();
|
||||
}
|
||||
@Watch("$route.query", { deep: true })
|
||||
async onRouteQueryChange() {
|
||||
// Reload image when any query parameter changes (fileName or _refresh)
|
||||
// This ensures the image refreshes when a new image is shared while already on this view
|
||||
await this.loadSharedImage();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user