()
| 58 | } |
| 59 | |
| 60 | login() { |
| 61 | if (getConnectionType() === connectionType.none) { |
| 62 | alert("Groceries requires an internet connection to log in."); |
| 63 | return; |
| 64 | } |
| 65 | |
| 66 | this.userService.login(this.user) |
| 67 | .subscribe( |
| 68 | () => { |
| 69 | this.isAuthenticating = false; |
| 70 | this.router.navigate(["/"]); |
| 71 | }, |
| 72 | (error) => { |
| 73 | alert("Unfortunately we could not find your account."); |
| 74 | this.isAuthenticating = false; |
| 75 | } |
| 76 | ); |
| 77 | } |
| 78 | |
| 79 | signUp() { |
| 80 | if (getConnectionType() === connectionType.none) { |