fixed opening files on mac #206 #243

This commit is contained in:
Jan Prochazka
2022-04-10 10:57:31 +02:00
parent 12a638af3b
commit 05619faa7a
4 changed files with 12 additions and 3 deletions

View File

@@ -164,14 +164,19 @@ const authTypesLoader = ({ engine }) => ({
url: 'plugins/auth-types',
params: { engine },
reloadTrigger: `installed-plugins-changed`,
errorValue: null,
});
async function getCore(loader, args) {
const { url, params, reloadTrigger, transform, onLoaded } = loader(args);
const { url, params, reloadTrigger, transform, onLoaded, errorValue } = loader(args);
const key = stableStringify({ url, ...params });
async function doLoad() {
const resp = await apiCall(url, params);
if (resp?.errorMessage && errorValue !== undefined) {
if (onLoaded) onLoaded(errorValue);
return errorValue;
}
const res = (transform || (x => x))(resp);
if (onLoaded) onLoaded(res);
return res;

View File

@@ -139,6 +139,7 @@ export async function openElectronFile() {
{ name: `SQLite database`, extensions: ['sqlite', 'db', 'sqlite3'] },
...getFileFormatFilters(ext),
],
properties: ['showHiddenFiles', 'openFile'],
});
const filePath = filePaths && filePaths[0];
if (canOpenByElectron(filePath, ext)) {