fix: scoreinfo store
This commit is contained in:
parent
1d22bfe6b3
commit
b8e87a9f6d
1 changed files with 3 additions and 2 deletions
|
@ -3,8 +3,9 @@
|
||||||
// run at document-start
|
// run at document-start
|
||||||
export const ugappJsStore: Record<string, any> | null = (() => {
|
export const ugappJsStore: Record<string, any> | null = (() => {
|
||||||
try {
|
try {
|
||||||
const el = document.querySelector('.js-store') as HTMLDivElement
|
const l = document.body.children as HTMLCollectionOf<HTMLElement>
|
||||||
const json = el.dataset.content as string
|
const el = [...l].find(e => Object.keys(e.dataset).length > 0) as HTMLDivElement
|
||||||
|
const json = Object.values(el.dataset)[0] as string
|
||||||
return JSON.parse(json)
|
return JSON.parse(json)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
|
|
Loading…
Reference in a new issue