Skip to content

Commit

Permalink
🐛 (vue) Use computed src value on iframe element"
Browse files Browse the repository at this point in the history
  • Loading branch information
laymonage committed Feb 3, 2022
1 parent a998c84 commit 1448a21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vue/lib/Giscus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const Giscus = defineComponent({
} else if (savedSession) {
try {
session.value = JSON.parse(savedSession || '') || ''
} catch (e) {
} catch (e: any) {
session.value = ''
localStorage.removeItem(GISCUS_SESSION_KEY)
console.warn(`${formatError(e?.message)} Session has been cleared.`)
Expand All @@ -93,7 +93,6 @@ const Giscus = defineComponent({
onMounted(() => {
if (!iframe.value) return
iframe.value = iframe.value as HTMLIFrameElement
iframe.value.src = src.value
iframe.value.addEventListener('load', () =>
iFrameResizer.iframeResizer(
{ checkOrigin: [GISCUS_ORIGIN] },
Expand All @@ -112,6 +111,7 @@ const Giscus = defineComponent({
<iframe
title="Comments"
className="giscus-frame"
src={src.value}
ref={iframe as any as LegacyRef<HTMLIFrameElement>}
/>
</div>
Expand Down

0 comments on commit 1448a21

Please sign in to comment.