Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix image picker shown when there are 0 images

Abdullah Atta108c9e2944b6
diff --git a/apps/web/src/common/dialog-controller.tsx b/apps/web/src/common/dialog-controller.tsx
index 80287b691..d5200b191 100644
--- a/apps/web/src/common/dialog-controller.tsx
+++ b/apps/web/src/common/dialog-controller.tsx
@@ -502,6 +502,8 @@ export function showEditProfilePictureDialog(profile?: Profile) {
}
export function showImagePickerDialog(images: File[]): Promise<false | File[]> {
+ if (images.length <= 0) return Promise.resolve(false);
+
return showDialog("ImagePickerDialog", (Dialog, perform) => (
<Dialog onClose={(res) => perform(res)} images={images} />
));