stricter CSP compat in appearance tab

This commit is contained in:
Henry Jameson 2025-06-28 21:43:50 +03:00
commit 9fbf426388
2 changed files with 5 additions and 21 deletions

View file

@ -155,13 +155,15 @@ const AppearanceTab = {
}))
})
this.previewTheme('stock', 'v3')
if (window.IntersectionObserver) {
this.intersectionObserver = new IntersectionObserver((entries, observer) => {
entries.forEach(({ target, isIntersecting }) => {
if (!isIntersecting) return
const theme = this.availableStyles.find(x => x.key === target.dataset.themeKey)
this.$nextTick(() => {
if (theme) theme.ready = true
if (theme) this.previewTheme(theme.key, theme.version, theme.data)
})
observer.unobserve(target)
})