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)); })