Skip to content

Commit

Permalink
🐛 (svelte) Check ref before create script tag
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed Jul 8, 2021
1 parent ace3e6e commit a9ff095
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/svelte/lib/Utterances.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
})()
let divRef: HTMLDivElement;
let divRef: HTMLDivElement | undefined;
onMount(() => {
if(!divRef) return
const scriptEl = createScriptElement({
repo,
theme,
Expand Down
21 changes: 20 additions & 1 deletion packages/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"./package.json": "./package.json"
},
"sideEffects": false,
"svelte": "lib/Utterances.svelte",
"scripts": {
"cz": "yarn --cwd ../.. cz",
"commit": "yarn cz",
Expand All @@ -40,5 +39,25 @@
"type": "git",
"url": "https://github.com/TomokiMiyauci/utterances-component.git",
"directory": "packages/svelte"
},
"files": [
"dist"
],
"keywords": [
"utterances",
"utterance",
"comment",
"comments",
"comment-system",
"vue",
"github",
"component",
"issue"
],
"homepage": "https://github.com/TomokiMiyauci/utterances-component#readme",
"bugs": "https://github.com/TomokiMiyauci/utterances-component/issues",
"funding": {
"type": "patreon",
"url": "https://www.patreon.com/tomoki_miyauci"
}
}

0 comments on commit a9ff095

Please sign in to comment.