app: file type filter on desktop + multiple files (#18403)

This commit is contained in:
Brendan Allan 2026-03-20 23:02:07 +08:00 committed by GitHub
commit d0a57305ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 120 additions and 60 deletions

View file

@ -1,6 +1,8 @@
// @refresh reload
import {
ACCEPTED_FILE_EXTENSIONS,
ACCEPTED_FILE_TYPES,
AppBaseProviders,
AppInterface,
handleNotificationClick,
@ -111,6 +113,8 @@ const createPlatform = (): Platform => {
const result = await window.api.openFilePicker({
multiple: opts?.multiple ?? false,
title: opts?.title ?? t("desktop.dialog.chooseFile"),
accept: opts?.accept ?? ACCEPTED_FILE_TYPES,
extensions: opts?.extensions ?? ACCEPTED_FILE_EXTENSIONS,
})
return handleWslPicker(result)
},