Skip to content

Commit

Permalink
Improved: used spinner instead of loader while logging in (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Aug 22, 2024
1 parent cd458f4 commit 1e3a4ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"Launch Pad": "Launch Pad",
"Login": "Login",
"Logout": "Logout",
"Logging in...": "Logging in...",
"Logging out...": "Logging out...",
"Next": "Next",
"Not configured": "Not configured",
Expand Down
14 changes: 9 additions & 5 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
</ion-item>

<div class="ion-padding">
<ion-button color="primary" expand="block" @click="login()">
<ion-button color="primary" expand="block" @click="isLoggingIn ? '' : login()">
{{ $t("Login") }}
<ion-icon slot="end" :icon="arrowForwardOutline" />
<ion-spinner v-if="isLoggingIn" name="crescent" />
<ion-icon v-else slot="end" :icon="arrowForwardOutline" />
</ion-button>
</div>
</section>
Expand Down Expand Up @@ -64,6 +65,7 @@ import {
IonInput,
IonItem,
IonPage,
IonSpinner,
loadingController
} from "@ionic/vue";
import { defineComponent } from "vue";
Expand All @@ -88,6 +90,7 @@ export default defineComponent({
IonInput,
IonItem,
IonPage,
IonSpinner,
Logo
},
data () {
Expand All @@ -102,7 +105,8 @@ export default defineComponent({
hideBackground: true,
isConfirmingForActiveSession: false,
loader: null as any,
loginOption: {} as any
loginOption: {} as any,
isLoggingIn: false
};
},
ionViewWillEnter() {
Expand Down Expand Up @@ -242,7 +246,7 @@ export default defineComponent({
return
}
this.presentLoader('Logging in...')
this.isLoggingIn = true;
try {
await this.authStore.login(username.trim(), password)
if (this.authStore.getRedirectUrl) {
Expand All @@ -256,7 +260,7 @@ export default defineComponent({
} catch (error) {
console.error(error)

Check warning on line 261 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (18.x)

Unexpected console statement

Check warning on line 261 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (20.x)

Unexpected console statement
}
this.dismissLoader()
this.isLoggingIn = false;
},
async samlLogin() {
try {
Expand Down

0 comments on commit 1e3a4ee

Please sign in to comment.