Skip to content

Commit

Permalink
fix: 预测列不显示
Browse files Browse the repository at this point in the history
  • Loading branch information
XYShaoKang committed Sep 22, 2024
1 parent c0c8045 commit 7e32285
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/content/pages/ranking/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function getUsername(
} else {
region = 'CN'
}
username = a.pathname.split('/').filter(Boolean)[1]
username = a.pathname?.split('/').filter(Boolean)[1]
} else {
const a = row.children[1].children[0] as HTMLAnchorElement
if (a.host === 'leetcode.com') {
Expand Down Expand Up @@ -74,10 +74,7 @@ export const useRowChange = (
}, 100)
handleChange()
const observer = new MutationObserver(handleChange)
const a = beta
? row.children[0].children[0].children[0].children[0]
: row.children[1].children[0]
observer.observe(a, { attributes: true, childList: true })
observer.observe(row, { attributes: true, childList: true })
return () => {
handleChange.cancel()
observer.disconnect()
Expand Down

0 comments on commit 7e32285

Please sign in to comment.