Skip to content

Commit

Permalink
fix(Settings): Provide better error when credentials are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ndickerson committed Jun 13, 2018
1 parent 10301ca commit 0628862
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/app/components/load/load.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,17 @@ export class LoadComponent implements OnInit, OnDestroy {
}

load(): void {
Utils.setExistField(this.settings, this.existField);
this.fileService.writeSettings(this.settings);
this.started.emit();
this.settings = this.fileService.readSettings();
if (!this.settings.username || !this.settings.password || !this.settings.clientId || !this.settings.clientSecret) {
this.modalService.open(ErrorModalComponent, {
title: 'Missing Login Credentials',
message: 'Open settings and fill out credentials before loading data',
});
} else {
Utils.setExistField(this.settings, this.existField);
this.fileService.writeSettings(this.settings);
this.started.emit();
}
}

private onFileChange(API: FieldInteractionApi): void {
Expand Down

0 comments on commit 0628862

Please sign in to comment.