From c19581e602ab853a1a32f2fcae45d7a261b98447 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Thu, 22 Aug 2019 16:24:32 +0800 Subject: [PATCH] [O] Optimize error handling in login.ts --- src/components/login/login.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/login/login.ts b/src/components/login/login.ts index 0b729c6..91ca99b 100644 --- a/src/components/login/login.ts +++ b/src/components/login/login.ts @@ -32,6 +32,12 @@ export default class Login extends Vue this.$emit('login:courses', JSON.parse(text)); }) }) - .catch(alert); + .catch(err => + { + alert(err); + + // Allow the user to retry + this.loading = false; + }); } }