Skip to content

A local-first personal finance app

Import qfx safari mobile (#6020)

dbequeaithae6bea2b1598
diff --git a/packages/desktop-client/src/browser-preload.browser.js b/packages/desktop-client/src/browser-preload.browser.js
index cf1aadcc6d..7c59a0170e 100644
--- a/packages/desktop-client/src/browser-preload.browser.js
+++ b/packages/desktop-client/src/browser-preload.browser.js
@@ -100,6 +100,19 @@ global.Actual = {
restartElectronServer: () => {},
openFileDialog: async ({ filters = [] }) => {
+ const FILE_ACCEPT_OVERRIDES = {
+ // Safari on iOS requires explicit MIME/UTType values for some extensions to allow selection.
+ qfx: [
+ 'application/vnd.intu.qfx',
+ 'application/x-qfx',
+ 'application/qfx',
+ 'application/ofx',
+ 'application/x-ofx',
+ 'application/octet-stream',
+ 'com.intuit.qfx',
+ ],
+ };
+
return new Promise(resolve => {
let createdElement = false;
// Attempt to reuse an already-created file input.
@@ -117,7 +130,15 @@ global.Actual = {
const filter = filters.find(filter => filter.extensions);
if (filter) {
- input.accept = filter.extensions.map(ext => '.' + ext).join(',');
+ input.accept = filter.extensions
+ .flatMap(ext => {
+ const normalizedExt = ext.startsWith('.')
+ ? ext.toLowerCase()
+ : `.${ext.toLowerCase()}`;
+ const overrides = FILE_ACCEPT_OVERRIDES[ext.toLowerCase()] ?? [];
+ return [normalizedExt, ...overrides];
+ })
+ .join(',');
}
input.style.position = 'absolute';
diff --git a/upcoming-release-notes/6020.md b/upcoming-release-notes/6020.md
new file mode 100644
index 0000000000..8ab71e478a
--- /dev/null
+++ b/upcoming-release-notes/6020.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [dbequeaith]
+---
+
+Allows selection of quicken (qfx) files for import on safari mobile