Skip to content

Commit ae6bea2

Browse files
Import qfx safari mobile (#6020)
* Supports selecting qfx files on safari mobile Fixes #4283 accept explicit MIME types associated with qfx files * generated release notes * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 3748153 commit ae6bea2

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

packages/desktop-client/src/browser-preload.browser.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ global.Actual = {
100100
restartElectronServer: () => {},
101101

102102
openFileDialog: async ({ filters = [] }) => {
103+
const FILE_ACCEPT_OVERRIDES = {
104+
// Safari on iOS requires explicit MIME/UTType values for some extensions to allow selection.
105+
qfx: [
106+
'application/vnd.intu.qfx',
107+
'application/x-qfx',
108+
'application/qfx',
109+
'application/ofx',
110+
'application/x-ofx',
111+
'application/octet-stream',
112+
'com.intuit.qfx',
113+
],
114+
};
115+
103116
return new Promise(resolve => {
104117
let createdElement = false;
105118
// Attempt to reuse an already-created file input.
@@ -117,7 +130,15 @@ global.Actual = {
117130

118131
const filter = filters.find(filter => filter.extensions);
119132
if (filter) {
120-
input.accept = filter.extensions.map(ext => '.' + ext).join(',');
133+
input.accept = filter.extensions
134+
.flatMap(ext => {
135+
const normalizedExt = ext.startsWith('.')
136+
? ext.toLowerCase()
137+
: `.${ext.toLowerCase()}`;
138+
const overrides = FILE_ACCEPT_OVERRIDES[ext.toLowerCase()] ?? [];
139+
return [normalizedExt, ...overrides];
140+
})
141+
.join(',');
121142
}
122143

123144
input.style.position = 'absolute';

upcoming-release-notes/6020.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Bugfix
3+
authors: [dbequeaith]
4+
---
5+
6+
Allows selection of quicken (qfx) files for import on safari mobile

0 commit comments

Comments
 (0)