Skip to content

Commit 7e32285

Browse files
committed
fix: 预测列不显示
1 parent c0c8045 commit 7e32285

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/content/pages/ranking/utils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function getUsername(
4646
} else {
4747
region = 'CN'
4848
}
49-
username = a.pathname.split('/').filter(Boolean)[1]
49+
username = a.pathname?.split('/').filter(Boolean)[1]
5050
} else {
5151
const a = row.children[1].children[0] as HTMLAnchorElement
5252
if (a.host === 'leetcode.com') {
@@ -74,10 +74,7 @@ export const useRowChange = (
7474
}, 100)
7575
handleChange()
7676
const observer = new MutationObserver(handleChange)
77-
const a = beta
78-
? row.children[0].children[0].children[0].children[0]
79-
: row.children[1].children[0]
80-
observer.observe(a, { attributes: true, childList: true })
77+
observer.observe(row, { attributes: true, childList: true })
8178
return () => {
8279
handleChange.cancel()
8380
observer.disconnect()

0 commit comments

Comments
 (0)