fix: use XDG_DOWNLOAD_DIR as default download dir (#2615)
On Linux machines that are using a desktop env which conforms to the FreeDesktop spec, users should have the XDG_DOWNLOAD_DIR variable set to specify their default download directory. This patch ensures that this directory is used if the variable is present. Hoping this will fix the following issue in the Mattermost snap: https://github.com/snapcrafters/mattermost-desktop/issues/65
This commit is contained in:
@@ -19,6 +19,11 @@ export const getDefaultDownloadLocation = (): string | undefined => {
|
||||
if (__IS_MAC_APP_STORE__) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (process.platform === 'linux' && process.env.XDG_DOWNLOAD_DIR) {
|
||||
return process.env.XDG_DOWNLOAD_DIR;
|
||||
}
|
||||
|
||||
return path.join(os.homedir(), 'Downloads');
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user