Skip to content

Commit 8a9a6e6

Browse files
committed
fix(mobile): retain dropped image previews after activity recreation
1 parent 49f72fa commit 8a9a6e6

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

‎apps/mobile/src/lib/composerImages.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ describe("native pasted image cleanup", () => {
213213
name: "pasted-image.jpeg",
214214
mimeType: "image/jpeg",
215215
dataUrl: "data:image/jpeg;base64,aGVsbG8=",
216-
previewUri: uri,
216+
previewUri: "data:image/jpeg;base64,aGVsbG8=",
217217
}),
218218
]);
219219
expect(files.get(uri)?.deleted).toBe(false);

‎apps/mobile/src/lib/composerImages.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,7 @@ export async function convertPastedImagesToAttachments(input: {
710710
mimeType,
711711
sizeBytes,
712712
dataUrl: `data:${mimeType};base64,${base64}`,
713-
previewUri:
714-
temporaryUris.length > 0 ? `data:${mimeType};base64,${base64}` : (fitted?.uri ?? uri),
713+
previewUri: `data:${mimeType};base64,${base64}`,
715714
});
716715
} catch (error) {
717716
console.warn("Failed to read pasted image", uri, error);

0 commit comments

Comments
 (0)