(cherry picked from commit 9b3d37e953
)
Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
This commit is contained in:
parent
b881eb61c6
commit
afc8f86875
|
@ -12,12 +12,14 @@ import os from 'os';
|
||||||
|
|
||||||
import {ConfigV3} from 'types/config';
|
import {ConfigV3} from 'types/config';
|
||||||
|
|
||||||
export const getDefaultDownloadLocation = (): string => {
|
export const getDefaultDownloadLocation = (): string | undefined => {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const homePath = __IS_MAC_APP_STORE__ ? path.join(os.homedir(), '../../../../') : os.homedir();
|
if (__IS_MAC_APP_STORE__) {
|
||||||
return path.join(homePath, 'Downloads');
|
return undefined;
|
||||||
|
}
|
||||||
|
return path.join(os.homedir(), 'Downloads');
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultPreferences: ConfigV3 = {
|
const defaultPreferences: ConfigV3 = {
|
||||||
|
|
|
@ -368,7 +368,7 @@ function initializeAfterAppReady() {
|
||||||
}
|
}
|
||||||
item.setSaveDialogOptions({
|
item.setSaveDialogOptions({
|
||||||
title: filename,
|
title: filename,
|
||||||
defaultPath: path.resolve(Config.downloadLocation, filename),
|
defaultPath: Config.downloadLocation ? path.resolve(Config.downloadLocation, filename) : undefined,
|
||||||
filters,
|
filters,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ export type ConfigV3 = {
|
||||||
hideOnStart: boolean;
|
hideOnStart: boolean;
|
||||||
spellCheckerLocales: string[];
|
spellCheckerLocales: string[];
|
||||||
darkMode: boolean;
|
darkMode: boolean;
|
||||||
downloadLocation: string;
|
downloadLocation?: string;
|
||||||
spellCheckerURL?: string;
|
spellCheckerURL?: string;
|
||||||
lastActiveTeam?: number;
|
lastActiveTeam?: number;
|
||||||
startInFullscreen?: boolean;
|
startInFullscreen?: boolean;
|
||||||
|
@ -69,7 +69,7 @@ export type ConfigV2 = {
|
||||||
spellCheckerLocale: string;
|
spellCheckerLocale: string;
|
||||||
spellCheckerURL?: string;
|
spellCheckerURL?: string;
|
||||||
darkMode: boolean;
|
darkMode: boolean;
|
||||||
downloadLocation: string;
|
downloadLocation?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ConfigV1 = {
|
export type ConfigV1 = {
|
||||||
|
|
Loading…
Reference in a new issue