diff --git a/src/App.vue b/src/App.vue index d834a925..3fb598a9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -43,16 +43,16 @@ initialise({ } }) -async function presentLoader(options = { message: "Click the backdrop to dismiss.", backdropDismiss: true }) { +async function presentLoader(options = { message: '', backdropDismiss: false }) { // When having a custom message remove already existing loader, if not removed it takes into account the already existing loader if(options.message && loader.value) dismissLoader(); if (!loader.value) { loader.value = await loadingController .create({ - message: translate(options.message), + message: options.message ? translate(options.message) : (options.backdropDismiss ? translate("Click the backdrop to dismiss.") : translate("Loading...")), translucent: true, - backdropDismiss: options.backdropDismiss + backdropDismiss: options.backdropDismiss || false }); } loader.value.present(); diff --git a/src/locales/en.json b/src/locales/en.json index 77a0f320..f9242c48 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -165,6 +165,7 @@ "Leave page": "Leave page", "Line status": "Line status", "Loading": "Loading", + "Loading...": "Loading...", "Loading cycle count details": "Loading cycle count details", "Location": "Location", "Log variance": "Log variance", diff --git a/src/store/modules/user/actions.ts b/src/store/modules/user/actions.ts index e6f3c8f3..dedaae62 100644 --- a/src/store/modules/user/actions.ts +++ b/src/store/modules/user/actions.ts @@ -53,7 +53,7 @@ const actions: ActionTree = { } } - emitter.emit("presentLoader", { message: "Logging in...", backdropDismiss: false }) + emitter.emit("presentLoader", { message: "Logging in..." }) const api_key = await UserService.login(token) const userProfile = await UserService.getUserProfile(api_key); @@ -86,7 +86,7 @@ const actions: ActionTree = { * Logout user */ async logout({ commit, dispatch }) { - emitter.emit('presentLoader', { message: 'Logging out', backdropDismiss: false }) + emitter.emit('presentLoader', { message: 'Logging out' }) const authStore = useAuthStore()