MM-60782 - use default download directory on windows (#3161)

* MM-60782 - use default download directory on windows

* fix unit tests
This commit is contained in:
Pablo Vélez
2024-10-18 15:39:56 +02:00
committed by GitHub
parent d047febb93
commit da88b8643e
12 changed files with 93 additions and 1 deletions

View File

@@ -5,6 +5,8 @@
import os from 'os';
import path from 'path';
import {app} from 'electron';
/**
* Default user preferences. End-users can change these parameters by editing config.json
* @param {number} version - Scheme version. (Not application version)
@@ -24,7 +26,7 @@ export const getDefaultDownloadLocation = (): string | undefined => {
return process.env.XDG_DOWNLOAD_DIR;
}
return path.join(os.homedir(), 'Downloads');
return app.getPath('downloads') || path.join(os.homedir(), 'Downloads');
};
const defaultPreferences: ConfigV3 = {