diff --git a/build/app.bundle.js b/build/app.bundle.js index abef558f..2460115d 100644 --- a/build/app.bundle.js +++ b/build/app.bundle.js @@ -1883,9 +1883,18 @@ class TokenDialogController { environment: this.environment, token: this.token }).then(accounts => { + const message = "If your account id contains only digits " + + "(ie. 2534233), it is a legacy account and you should use " + + "release 3.x. For v20 accounts use release 4.x or higher. " + + "Check your token."; + + if (!accounts.length) { + throw new Error(message); + } angular.extend(this.accounts, accounts); - }, err => { + }).catch(err => { this.ToastsService.addToast(err); + this.closeModal(); }); } diff --git a/src/client/app/components/token-dialog/token-dialog.controller.js b/src/client/app/components/token-dialog/token-dialog.controller.js index e00f167d..b380b1f9 100644 --- a/src/client/app/components/token-dialog/token-dialog.controller.js +++ b/src/client/app/components/token-dialog/token-dialog.controller.js @@ -42,9 +42,18 @@ export class TokenDialogController { environment: this.environment, token: this.token }).then(accounts => { + const message = "If your account id contains only digits " + + "(ie. 2534233), it is a legacy account and you should use " + + "release 3.x. For v20 accounts use release 4.x or higher. " + + "Check your token."; + + if (!accounts.length) { + throw new Error(message); + } angular.extend(this.accounts, accounts); - }, err => { + }).catch(err => { this.ToastsService.addToast(err); + this.closeModal(); }); }