Skip to content

Commit 74e43d5

Browse files
committed
Improve checking for async gap
1 parent 93e4b53 commit 74e43d5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ export default defineComponent({
4444
const _ = this.$el.appendChild(document.createElement('span'))
4545
const _this = this
4646
import(/* webpackMode: "eager" */ 'github-buttons').then(function (module) {
47-
if (_this.$refs._ == null) {
47+
if (_this.$el.lastChild !== _) {
4848
return
4949
}
5050
module.render(_.appendChild(_this.$refs._), function (el) {
51-
try {
52-
_.parentNode.replaceChild(el, _)
53-
} catch (_) {}
51+
if (_this.$el.lastChild !== _) {
52+
return
53+
}
54+
_.parentNode.replaceChild(el, _)
5455
})
5556
})
5657
},

0 commit comments

Comments
 (0)