SDA-4380 - fix userDataPath validation (#2004)

This commit is contained in:
Kiran Niranjan 2023-11-02 14:39:50 +05:30 committed by GitHub
parent d3d91c3d70
commit 74868c2667
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ class AutoLaunchController {
*/
public enableAutoLaunch(): void {
const { userDataPath } = config.getConfigFields(['userDataPath']);
if (userDataPath === '') {
if (!userDataPath) {
app.setLoginItemSettings({ openAtLogin: true, path: props.path });
} else {
app.setLoginItemSettings({
@ -67,9 +67,8 @@ class AutoLaunchController {
const { launchOnStartup }: IConfig = config.getConfigFields([
'launchOnStartup',
]);
const {
openAtLogin: isAutoLaunchEnabled,
}: LoginItemSettings = this.isAutoLaunchEnabled();
const { openAtLogin: isAutoLaunchEnabled }: LoginItemSettings =
this.isAutoLaunchEnabled();
if (launchOnStartup === CloudConfigDataTypes.ENABLED) {
if (!isAutoLaunchEnabled) {