Skip to content

Commit 49bc6ef

Browse files
committed
fix: repeated mounting of dynamic pages
1 parent 2546a1d commit 49bc6ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/content-script/index.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ import { changeLanguage } from 'i18next'
2525
*/
2626
async function mountComponent(siteConfig, userConfig) {
2727
const retry = 10
28+
let oldUrl = location.href
2829
for (let i = 1; i <= retry; i++) {
30+
if (location.href !== oldUrl) {
31+
console.log(`SiteAdapters Retry ${i}/${retry}: stop`)
32+
return
33+
}
2934
const e =
3035
(siteConfig &&
3136
(getPossibleElementByQuerySelector(siteConfig.sidebarContainerQuery) ||

0 commit comments

Comments
 (0)