Skip to content

Commit

Permalink
fix: 找到正确的图标元素
Browse files Browse the repository at this point in the history
修复在比赛进行期间,会对 WA 图标进行替换
  • Loading branch information
XYShaoKang committed Mar 21, 2022
1 parent cc2b651 commit 1304e03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content/pages/ranking/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ async function loadFileIcon() {
trs.forEach((tr, i) => {
const codetds = Array.from(tr.children).slice(4, 8)
for (let j = 0; j < 4; j++) {
const iconEl = codetds[j]?.children?.[0]?.children?.[0]
const parent = codetds[j]?.querySelector('a')
const iconEl = parent?.querySelector('span')

if (iconEl) {
if (parent && iconEl) {
if (fileIconStates[i][j]) continue
const parent = iconEl.parentNode! as HTMLAnchorElement
parent.removeChild(iconEl)

render(
Expand Down

0 comments on commit 1304e03

Please sign in to comment.