web/satellite: unnecessary console error on no paywall user's login removed

WHAT:
in case when user was in no paywall cohourt, unnecessary error message appeared in console after login.
Error removed.

WHY:
better user experience.

Change-Id: Ieafd756e3dc0d6a10bf0058b52ebfaf38d02e8fd
This commit is contained in:
VitaliiShpital 2020-09-21 15:33:13 +03:00 committed by Vitalii Shpital
parent 54dd430048
commit 1e5641aa55
2 changed files with 14 additions and 12 deletions

View File

@ -45,7 +45,7 @@ export default class NoPaywallInfoBar extends Vue {
return item.type === PaymentsHistoryItemType.Coupon;
});
return coupons[coupons.length - 1];
return coupons[coupons.length - 1] || new PaymentsHistoryItem(); // returns new item in case when coupons array is empty.
}
}
</script>

View File

@ -41,19 +41,16 @@ export default class Login extends Vue {
// Tardigrade logic
public isDropdownShown: boolean = false;
/**
* Lifecycle hook after initial render.
* Makes activated banner visible on successful account activation.
*/
public mounted(): void {
if (this.$route.query.activated === 'true') {
this.isActivatedBannerShown = true;
}
}
/**
* Checks if page is inside iframe
*/
public get isInsideIframe(): boolean {
return window.self !== window.top;
}
/**
* Reloads page.
*/
@ -61,11 +58,17 @@ export default class Login extends Vue {
location.reload();
}
/**
* Sets email string on change.
*/
public setEmail(value: string): void {
this.email = value;
this.emailError = '';
}
/**
* Sets password string on change.
*/
public setPassword(value: string): void {
this.password = value;
this.passwordError = '';
@ -121,15 +124,14 @@ export default class Login extends Vue {
return;
}
if (this.isInsideIframe) {
window.top.location.href = window.self.location.origin + '/account/billing';
}
await this.$store.dispatch(APP_STATE_ACTIONS.CHANGE_STATE, AppState.LOADING);
this.isLoading = false;
await this.$router.push(RouteConfig.ProjectDashboard.path);
}
/**
* Validates email and password input strings.
*/
private validateFields(): boolean {
let isNoErrors = true;