From e7daac738d415ceb4300bda1632f71ba26c4d965 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Wed, 21 Aug 2019 14:56:50 +0800 Subject: [PATCH] [+] Enable and disable loading at appropriate time --- src/components/login/login.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/login/login.ts b/src/components/login/login.ts index 4e50b89..7d48821 100644 --- a/src/components/login/login.ts +++ b/src/components/login/login.ts @@ -22,12 +22,18 @@ export default class Login extends Vue // Call custom event this.$emit('login:click', this.username, this.password); + // Make login button loading + this.loading = true; + // Fetch request TODO: Add username and password when the https server is ready. fetch(`${Constants.API_URL}/veracross/courses`).then(res => { // Get response body text res.text().then(text => { + // Disable loading + this.loading = false; + // Call custom event with courses info this.$emit('login:courses', JSON.parse(text)); })