From 805472482e4197dc0bbda64e163d8fc6ff3d8d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Wed, 29 Apr 2020 06:09:17 +0900 Subject: [PATCH] Refactor code --- src/client/components/hcaptcha.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/components/hcaptcha.vue b/src/client/components/hcaptcha.vue index f49336648..4bc03342f 100644 --- a/src/client/components/hcaptcha.vue +++ b/src/client/components/hcaptcha.vue @@ -40,11 +40,11 @@ export default Vue.extend({ if (window.hcaptcha) { // loaded this.available = true; } else { - (document.getElementById('hcaptcha') || (x => document.head.appendChild(Object.assign(x, { + (document.getElementById('hcaptcha') || document.head.appendChild(Object.assign(document.createElement('script'), { async: true, id: 'hcaptcha', src: 'https://hcaptcha.com/1/api.js?render=explicit', - })))(document.createElement('script'))) + }))) .addEventListener('load', () => this.available = true); } },