Merge remote-tracking branch 'origin/main' into wilm
# Conflicts: # frontend/src/views/settings/SiteSettings.vue
This commit is contained in:
@@ -6,7 +6,7 @@ import { setupComplete, setupSkipped, isSetupLoaded, refreshSetupState,
|
||||
needsAdmin, isNeedsAdminLoaded, refreshNeedsAdmin } from '../composables/setupState'
|
||||
import { loadEnabledPlugins, isPluginEnabled } from '../composables/enabledPlugins'
|
||||
import { useToast } from '../composables/toast'
|
||||
import { getFacilityName } from '../utils/siteSettings'
|
||||
import { beginNavigation, applyGenericTitle } from '../composables/pageTitle'
|
||||
import { stagedChildren, stagedToplevel } from './routes.gen'
|
||||
|
||||
// Auto-discover all route modules from routes/ directory. A module's default
|
||||
@@ -147,14 +147,12 @@ function pageTitleFor(route) {
|
||||
word.charAt(0).toUpperCase() + word.slice(1)).join(' ')
|
||||
}
|
||||
|
||||
router.afterEach(async (to) => {
|
||||
let siteTitle = 'ShopDB'
|
||||
try {
|
||||
const facility = await getFacilityName()
|
||||
if (facility && facility !== 'ShopDB') siteTitle = `${facility} ShopDB`
|
||||
} catch (titleError) { /* settings unavailable - plain ShopDB */ }
|
||||
const page = pageTitleFor(to)
|
||||
document.title = page && page !== 'Home' ? `${siteTitle} - ${page}` : siteTitle
|
||||
router.afterEach((to) => {
|
||||
// Claim the route BEFORE awaiting anything: a detail view that resolves
|
||||
// quickly sets the record title, and the generic write below must not
|
||||
// overwrite it. See composables/pageTitle.js.
|
||||
beginNavigation(to.fullPath)
|
||||
applyGenericTitle(to.fullPath, pageTitleFor(to))
|
||||
})
|
||||
|
||||
// A deploy replaces the hashed chunk files, so a tab that was open across it
|
||||
|
||||
Reference in New Issue
Block a user