mirror of
https://github.com/baserow/baserow.git
synced 2026-12-05 00:38:35 +00:00
* Fix preview error with page parameter * Fix OIDC form support * Fix input border color * Fix some builder inputs * Clear some TODO MIGs * Clean comments * Update snapshot * Fix page title * Fix reactivity issue * refactor: replace individual RadioButtons with a RadioGroup component for choice option type selection. * Fix domain --------- Co-authored-by: Jonathan Adeline <jonathan@baserow.io>
23 lines
749 B
JavaScript
23 lines
749 B
JavaScript
/**
|
|
* If this middleware is added to a page, it will load the pending jobs
|
|
* for the user from the server in order to show them in the UI.
|
|
*/
|
|
export default defineNuxtRouteMiddleware(async () => {
|
|
const nuxtApp = useNuxtApp()
|
|
const store = nuxtApp.$store
|
|
const event = import.meta.server ? useRequestEvent() : null
|
|
|
|
// If nuxt generate, pass this middleware
|
|
if (import.meta.server && !event) return
|
|
|
|
if (
|
|
// If the user is not authenticated we can't fetch unfinished jobs.
|
|
store.getters['auth/isAuthenticated'] &&
|
|
// If the unfinished jobs haven't been loaded we will load them all.
|
|
!store.getters['job/isLoaded'] &&
|
|
!store.getters['job/isLoading']
|
|
) {
|
|
await store.dispatch('job/fetchAllUnfinished')
|
|
}
|
|
})
|