MAS: remove default download location (#2070)

This commit is contained in:
Devin Binnie 2022-04-25 09:37:43 -04:00 committed by GitHub
parent 78b4bbf357
commit 9b3d37e953
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View file

@ -12,12 +12,14 @@ import os from 'os';
import {ConfigV3} from 'types/config';
export const getDefaultDownloadLocation = (): string => {
export const getDefaultDownloadLocation = (): string | undefined => {
// eslint-disable-next-line no-undef
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const homePath = __IS_MAC_APP_STORE__ ? path.join(os.homedir(), '../../../../') : os.homedir();
return path.join(homePath, 'Downloads');
if (__IS_MAC_APP_STORE__) {
return undefined;
}
return path.join(os.homedir(), 'Downloads');
};
const defaultPreferences: ConfigV3 = {

View file

@ -368,7 +368,7 @@ function initializeAfterAppReady() {
}
item.setSaveDialogOptions({
title: filename,
defaultPath: path.resolve(Config.downloadLocation, filename),
defaultPath: Config.downloadLocation ? path.resolve(Config.downloadLocation, filename) : undefined,
filters,
});

View file

@ -37,7 +37,7 @@ export type ConfigV3 = {
hideOnStart: boolean;
spellCheckerLocales: string[];
darkMode: boolean;
downloadLocation: string;
downloadLocation?: string;
spellCheckerURL?: string;
lastActiveTeam?: number;
startInFullscreen?: boolean;
@ -69,7 +69,7 @@ export type ConfigV2 = {
spellCheckerLocale: string;
spellCheckerURL?: string;
darkMode: boolean;
downloadLocation: string;
downloadLocation?: string;
}
export type ConfigV1 = {