Skip to content

Commit

Permalink
fix: clean no param reassign rule in components (#953)
Browse files Browse the repository at this point in the history
* fix: clean no param reassign rule in components

* fix: deleting clean directory
  • Loading branch information
deov31 authored Mar 5, 2024
1 parent f6eb05f commit 5cad08e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/storefront/src/components/ThemeFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ export function IFrameSetContent(
forceWrite = false
) {
if (el) {
const element = el
if ('srcdoc' in HTMLIFrameElement.prototype && !forceWrite) {
el.srcdoc = content
element.srcdoc = content
} else {
const iframeDoc = el.contentDocument
const iframeDoc = element.contentDocument
iframeDoc?.open('text/html', 'replace')
iframeDoc?.write(content)
iframeDoc?.close()
}
}
}

const handleLoad = (_iframeRef: RefObject<HTMLIFrameElement>) => {
// resolve iframe use document mousedown no effect
if (_iframeRef.current?.contentDocument?.addEventListener) {
Expand Down

0 comments on commit 5cad08e

Please sign in to comment.