diff --git a/CHANGELOG.md b/CHANGELOG.md index 012f650..1557bd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [0.14.3](https://github.com/XYShaoKang/refined-leetcode/compare/v0.14.2...v0.14.3) (2024-09-22) + + +### Bug Fixes + +* lint ([8778b17](https://github.com/XYShaoKang/refined-leetcode/commit/8778b17a5016a5818f2f667cfc65d71084a64999)) +* 预测列不显示 ([7e32285](https://github.com/XYShaoKang/refined-leetcode/commit/7e3228517de34e0a19fab21153dfda0c922ab095)) + ## [0.14.2](https://github.com/XYShaoKang/refined-leetcode/compare/v0.14.1...v0.14.2) (2024-09-21) diff --git a/package.json b/package.json index 7c16f30..9a84fb6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "refined-leetcode", - "version": "0.14.2", + "version": "0.14.3", "main": "index.js", "author": "XYShaoKang", "license": "MIT", diff --git a/src/content/pages/ranking/utils.ts b/src/content/pages/ranking/utils.ts index 5dc0486..2b52f36 100644 --- a/src/content/pages/ranking/utils.ts +++ b/src/content/pages/ranking/utils.ts @@ -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') { @@ -63,21 +63,14 @@ export function getUsername( /** 当前行发生改变是触发事件 */ -export const useRowChange = ( - row: HTMLElement, - onChange: () => void, - beta?: boolean -): void => { +export const useRowChange = (row: HTMLElement, onChange: () => void): void => { useEffect(() => { const handleChange = debounce(() => { onChange() }, 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() @@ -97,7 +90,7 @@ export const useUser = ( const handleChange = useEvent(() => { setState(getUsername(hasMyRank, index, row, beta)) }) - useRowChange(row, handleChange, beta) + useRowChange(row, handleChange) return state }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: