A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: fix error due to changed file picker return
Abdullah Atta156b844fd902
diff --git a/apps/web/src/common/index.ts b/apps/web/src/common/index.tsindex b2e102e3a..8a293fd81 100644--- a/apps/web/src/common/index.ts+++ b/apps/web/src/common/index.ts@@ -138,7 +138,7 @@ export async function createBackup() {}export async function selectBackupFile() {- const file = await showFilePicker({+ const [file] = await showFilePicker({acceptedFileTypes: ".nnbackup,.nnbackupz"});if (!file) return;diff --git a/apps/web/src/dialogs/edit-profile-picture-dialog.tsx b/apps/web/src/dialogs/edit-profile-picture-dialog.tsxindex c02ed1de2..d5405a59c 100644--- a/apps/web/src/dialogs/edit-profile-picture-dialog.tsx+++ b/apps/web/src/dialogs/edit-profile-picture-dialog.tsx@@ -64,8 +64,8 @@ export default function EditProfilePictureDialog(.getImageScaledToCanvas().toDataURL("image/jpeg", 0.8): clearProfilePicture- ? undefined- : profile?.profilePicture;+ ? undefined+ : profile?.profilePicture;await db.user.setProfile({profilePicture: pic});@@ -124,7 +124,7 @@ export default function EditProfilePictureDialog(sx={{ flex: 1 }}variant="secondary"onClick={async () => {- const file = await showFilePicker({+ const [file] = await showFilePicker({acceptedFileTypes: "image/*"});if (!file) return;diff --git a/apps/web/src/utils/file-picker.ts b/apps/web/src/utils/file-picker.tsindex 7fda8967f..275624bf5 100644--- a/apps/web/src/utils/file-picker.ts+++ b/apps/web/src/utils/file-picker.ts@@ -33,7 +33,7 @@ export function showFilePicker({input.setAttribute("accept", acceptedFileTypes);input.dispatchEvent(new MouseEvent("click"));input.oncancel = async function () {- resolve(undefined);+ resolve([]);};input.onchange = async function () {if (!input.files) return resolve([]);