From d4d2b49796327e817d5ac6a94c57f6d4725965ab Mon Sep 17 00:00:00 2001 From: 7heo <7heo@users.noreply.github.com> Date: Mon, 5 Jun 2023 23:34:32 +0200 Subject: [PATCH] Fix #421 --- .../ui/components/post/create/CreatePostActivity.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/jerboa/ui/components/post/create/CreatePostActivity.kt b/app/src/main/java/com/jerboa/ui/components/post/create/CreatePostActivity.kt index 9e5072923..dd1c8232c 100644 --- a/app/src/main/java/com/jerboa/ui/components/post/create/CreatePostActivity.kt +++ b/app/src/main/java/com/jerboa/ui/components/post/create/CreatePostActivity.kt @@ -129,10 +129,12 @@ fun CreatePostActivity( suggestedTitle = createPostViewModel.suggestedTitle, image = _image, onPickedImage = { uri -> + if (uri) { val imageIs = imageInputStreamFromUri(ctx, uri) - scope.launch { - account?.also { acct -> - url = uploadPictrsImage(acct, imageIs, ctx).orEmpty() + scope.launch { + account?.also { acct -> + url = uploadPictrsImage(acct, imageIs, ctx).orEmpty() + } } } },