From db6b198d18f9e92fc4ef2ea06e25141d2fba4eed Mon Sep 17 00:00:00 2001
From: John Fawcett <jrf0110@gmail.com>
Date: Sun, 19 Mar 2023 17:38:53 -0500
Subject: Fixes profile edit image selection not prompting users on web (#309)
 (#321)

* Fixes profile edit image selection not prompting users on web (#309)

* Fixes linting erros
---
 src/lib/media/picker.web.tsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'src/lib/media/picker.web.tsx')

diff --git a/src/lib/media/picker.web.tsx b/src/lib/media/picker.web.tsx
index 43675074e..158c37971 100644
--- a/src/lib/media/picker.web.tsx
+++ b/src/lib/media/picker.web.tsx
@@ -111,6 +111,18 @@ export async function cropAndCompressFlow(
 // helpers
 // =
 
+/**
+ * Opens the select file dialog in the browser.
+ * NOTE:
+ * If in the future someone updates this method to use:
+ * https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker
+ * Check that the `showOpenFilePicker` API does not require any permissions
+ * granted to use. As of this writing, it does not, but that could change
+ * in the future. If the user does need to go through a permissions granting
+ * flow, then checkout the usePhotoLibraryPermission() hook in
+ *   src/lib/hooks/usePermissions.ts
+ * so that it gets appropriately updated.
+ */
 function selectFile(opts: PickerOpts): Promise<PickedFile> {
   return new Promise((resolve, reject) => {
     var input = document.createElement('input')
-- 
cgit 1.4.1

