Skip to content

Commit 315242b

Browse files
committed
fix: site adapter switch not working for SPA (#147)
1 parent ea39d24 commit 315242b

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/content-script/index.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,19 @@ async function prepareForStaticCard() {
278278
const matches = location.hostname.match(siteRegex)
279279
if (matches) {
280280
const siteName = matches[0]
281+
282+
if (
283+
userConfig.siteAdapters.includes(siteName) &&
284+
!userConfig.activeSiteAdapters.includes(siteName)
285+
)
286+
return
287+
281288
if (siteName in siteConfig) {
282289
const siteAction = siteConfig[siteName].action
283290
if (siteAction && siteAction.init) {
284291
await siteAction.init(location.hostname, userConfig, getInput, mountComponent)
285292
}
286293
}
287-
if (
288-
userConfig.siteAdapters.includes(siteName) &&
289-
!userConfig.activeSiteAdapters.includes(siteName)
290-
)
291-
return
292294

293295
mountComponent(siteConfig[siteName], userConfig)
294296
}

0 commit comments

Comments
 (0)