mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
web: fix error due to changed file picker return
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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([]);
|
||||
|
||||
Reference in New Issue
Block a user