Skip to content

Commit

Permalink
fix: site adapter switch not working for SPA (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Apr 5, 2023
1 parent ea39d24 commit 315242b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/content-script/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,17 +278,19 @@ async function prepareForStaticCard() {
const matches = location.hostname.match(siteRegex)
if (matches) {
const siteName = matches[0]

if (
userConfig.siteAdapters.includes(siteName) &&
!userConfig.activeSiteAdapters.includes(siteName)
)
return

if (siteName in siteConfig) {
const siteAction = siteConfig[siteName].action
if (siteAction && siteAction.init) {
await siteAction.init(location.hostname, userConfig, getInput, mountComponent)
}
}
if (
userConfig.siteAdapters.includes(siteName) &&
!userConfig.activeSiteAdapters.includes(siteName)
)
return

mountComponent(siteConfig[siteName], userConfig)
}
Expand Down

0 comments on commit 315242b

Please sign in to comment.