Fix duplicate gallery saves and ensure FrameOverlay is captured by ViewShot on Android

This commit is contained in:
2026-05-31 21:53:19 +02:00
parent 0c0e78af41
commit a89d985075
3 changed files with 6 additions and 15 deletions
+6 -6
View File
@@ -41,14 +41,14 @@ export async function saveToGallery(localUri: string): Promise<string> {
if (!album) {
// 3. If it doesn't exist, create it with our asset
// copy=true avoids Android system dialog asking "can Schnappix change the photo?"
await createAlbumAsync(ALBUM_NAME, asset, true);
console.log(`Created new album "${ALBUM_NAME}" and saved photo.`);
// copyAsset=false MOVES the asset instead of duplicating it
await createAlbumAsync(ALBUM_NAME, asset, false);
console.log(`Created new album "${ALBUM_NAME}" and moved photo.`);
} else {
// 4. If it exists, add our asset to it
// copy=true avoids Android system dialog asking "can Schnappix change the photo?"
await addAssetsToAlbumAsync([asset], album, true);
console.log(`Saved photo to existing album "${ALBUM_NAME}".`);
// copyAsset=false MOVES the asset instead of duplicating it
await addAssetsToAlbumAsync([asset], album, false);
console.log(`Moved photo to existing album "${ALBUM_NAME}".`);
}
return asset.uri;