waibu 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,14 +56,13 @@ async function buildLocals ({ tpl, params = {}, opts = {} } = {}) {
56
56
  const { runHook } = this.app.bajo
57
57
  const { set, merge, pick, get, isEmpty, find, pullAt } = this.app.lib._
58
58
  const { req, reply } = opts
59
-
60
59
  const appTitle = this.app.waibuMpa ? req.t(this.app.waibuMpa.getAppTitle(req.ns)) : ''
61
60
  params.page = merge(params.page ?? {}, { ns: req.ns, appTitle })
62
61
  params.sidebar = params.sidebar ?? []
63
62
 
64
63
  const { site, user, lang, darkMode } = req
65
- const theme = pick(find(this.themes, { name: req.theme }) ?? {}, ['name', 'framework'])
66
- const iconset = pick(find(this.iconsets, { name: req.iconset }) ?? {}, ['name'])
64
+ const theme = pick(find(this.themes, { name: opts.theme ?? req.theme }) ?? {}, ['name', 'framework'])
65
+ const iconset = pick(find(this.iconsets, { name: opts.iconset ?? req.iconset }) ?? {}, ['name'])
67
66
  const routeOpts = get(req, 'routeOptions.config', {})
68
67
  const _meta = { theme, iconset, site, user, lang, darkMode, routeOpts }
69
68
  _meta.site = _meta.site ?? {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {