Skip to content

Commit 2bc7c50

Browse files
SDA-4267 (Remove config file if the file is empty) (#1944)
* SDA-4267 - Remove config file if the file is empty Signed-off-by: Kiran Niranjan <kiran.niranjan@symphony.com> * SDA-4267 - Remove config file if the file is empty Signed-off-by: Kiran Niranjan <kiran.niranjan@symphony.com> --------- Signed-off-by: Kiran Niranjan <kiran.niranjan@symphony.com>
1 parent ca20e6c commit 2bc7c50

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/app/app-menu.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ export class AppMenu {
626626
(windowHandler.url &&
627627
windowHandler.url.startsWith('https://corporate.symphony.com')) ||
628628
false;
629+
const updateChannel = this.getUpdateChannel();
629630
return {
630631
label: i18n.t('Help')(),
631632
role: 'help',
@@ -757,7 +758,7 @@ export class AppMenu {
757758
this.setUpdateChannelForMenuEntry(Target.SDA, Channels.Stable),
758759
visible: isCorp,
759760
type: 'checkbox',
760-
checked: this.getUpdateChannel() === Channels.Stable,
761+
checked: updateChannel === Channels.Stable,
761762
label: i18n.t('Stable')(),
762763
},
763764
{
@@ -766,7 +767,7 @@ export class AppMenu {
766767
this.setUpdateChannelForMenuEntry(Target.SDA, Channels.Latest),
767768
visible: isCorp,
768769
type: 'checkbox',
769-
checked: this.getUpdateChannel() === Channels.Latest,
770+
checked: updateChannel === Channels.Latest,
770771
label: i18n.t('Latest')(),
771772
},
772773
{
@@ -775,7 +776,7 @@ export class AppMenu {
775776
this.setUpdateChannelForMenuEntry(Target.SDA, Channels.IV),
776777
visible: isCorp && isWindowsOS,
777778
type: 'checkbox',
778-
checked: this.getUpdateChannel() === Channels.IV,
779+
checked: updateChannel === Channels.IV,
779780
label: i18n.t('IV Dogfooding')(),
780781
},
781782
{
@@ -784,7 +785,7 @@ export class AppMenu {
784785
this.setUpdateChannelForMenuEntry(Target.SDA, Channels.Beta),
785786
visible: isCorp,
786787
type: 'checkbox',
787-
checked: this.getUpdateChannel() === Channels.Beta,
788+
checked: updateChannel === Channels.Beta,
788789
label: i18n.t('Beta')(),
789790
},
790791
{
@@ -793,7 +794,7 @@ export class AppMenu {
793794
this.setUpdateChannelForMenuEntry(Target.SDA, Channels.Daily),
794795
visible: isCorp,
795796
type: 'checkbox',
796-
checked: this.getUpdateChannel() === Channels.Daily,
797+
checked: updateChannel === Channels.Daily,
797798
label: i18n.t('Daily')(),
798799
},
799800
],

src/app/config-handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ class Config {
602602
`config-handler: User configuration is empty and nothing to read`,
603603
userConfig,
604604
);
605+
fs.unlinkSync(this.userConfigPath);
605606
return;
606607
}
607608
this.userConfig = this.parseConfigData(userConfig);

0 commit comments

Comments
 (0)