fix blessing global

This commit is contained in:
Pig Fang 2020-06-28 22:23:10 +08:00
parent d242c124e9
commit b8dab4b57a
No known key found for this signature in database
GPG Key ID: A8198F548DADA9E2
2 changed files with 4 additions and 6 deletions

View File

@ -141,7 +141,6 @@ class HeadComposer
'base_url' => url('/'),
'site_name' => option_localized('site_name'),
'route' => request()->path(),
'i18n' => new \stdClass(),
];
$view->with('blessing', $blessing);
}

View File

@ -1,12 +1,11 @@
export function getExtraData(): any {
export function getExtraData(): Record<string, any> {
const jsonElement = document.querySelector('#blessing-extra')
/* istanbul ignore next */
if (jsonElement) {
return JSON.parse(jsonElement.textContent ?? '{}')
} else {
return {}
}
}
const extraData = getExtraData()
if (extraData) {
blessing.extra = extraData
}
blessing.extra = getExtraData()