summaryrefslogtreecommitdiff
path: root/packages/client/src
diff options
context:
space:
mode:
authorJohann150 <johann.galle@protonmail.com>2022-07-04 16:17:07 +0200
committerJohann150 <johann.galle@protonmail.com>2022-07-04 16:17:07 +0200
commit935fce338ab032e7acc41a3dd75f95f0e9ab1689 (patch)
treebcce2934e3d4f99b4b9ae1d48a4f4d36710f06f4 /packages/client/src
parentfix lint vue/require-valid-default-prop (diff)
downloadsharkey-935fce338ab032e7acc41a3dd75f95f0e9ab1689.tar.gz
sharkey-935fce338ab032e7acc41a3dd75f95f0e9ab1689.tar.bz2
sharkey-935fce338ab032e7acc41a3dd75f95f0e9ab1689.zip
refactor: remove unnecessary computed
Fixes lint no-const-assign.
Diffstat (limited to 'packages/client/src')
-rw-r--r--packages/client/src/pages/admin/bot-protection.vue11
1 files changed, 3 insertions, 8 deletions
diff --git a/packages/client/src/pages/admin/bot-protection.vue b/packages/client/src/pages/admin/bot-protection.vue
index d2e7919b4f..d316f973bc 100644
--- a/packages/client/src/pages/admin/bot-protection.vue
+++ b/packages/client/src/pages/admin/bot-protection.vue
@@ -61,27 +61,22 @@ let hcaptchaSecretKey: string | null = $ref(null);
let recaptchaSiteKey: string | null = $ref(null);
let recaptchaSecretKey: string | null = $ref(null);
-const enableHcaptcha = $computed(() => provider === 'hcaptcha');
-const enableRecaptcha = $computed(() => provider === 'recaptcha');
-
async function init() {
const meta = await os.api('admin/meta');
- enableHcaptcha = meta.enableHcaptcha;
hcaptchaSiteKey = meta.hcaptchaSiteKey;
hcaptchaSecretKey = meta.hcaptchaSecretKey;
- enableRecaptcha = meta.enableRecaptcha;
recaptchaSiteKey = meta.recaptchaSiteKey;
recaptchaSecretKey = meta.recaptchaSecretKey;
- provider = enableHcaptcha ? 'hcaptcha' : enableRecaptcha ? 'recaptcha' : null;
+ provider = meta.enableHcaptcha ? 'hcaptcha' : meta.enableRecaptcha ? 'recaptcha' : null;
}
function save() {
os.apiWithDialog('admin/update-meta', {
- enableHcaptcha,
+ enableHcaptcha: provider === 'hcaptcha',
hcaptchaSiteKey,
hcaptchaSecretKey,
- enableRecaptcha,
+ enableRecaptcha: provider === 'recaptcha',
recaptchaSiteKey,
recaptchaSecretKey,
}).then(() => {