From a599528044c127fe0e38a9ca29f5f6ff4327fb0c Mon Sep 17 00:00:00 2001
From: Corentin Thomasset <corentin.thomasset74@gmail.com>
Date: Tue, 4 Apr 2023 12:55:02 +0200
Subject: fix(otp-generator): editable secret

---
 .../otp-code-generator-and-validator.vue                       | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')

diff --git a/src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue b/src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue
index c435a33..d7bbd2b 100644
--- a/src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue
+++ b/src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue
@@ -63,9 +63,9 @@
 </template>
 
 <script setup lang="ts">
-import { computed, ref, watch } from 'vue';
+import { computed, ref } from 'vue';
 import { Refresh } from '@vicons/tabler';
-import { useTimestamp, useWindowFocus, whenever } from '@vueuse/core';
+import { useTimestamp } from '@vueuse/core';
 import { useThemeVars } from 'naive-ui';
 import { useStyleStore } from '@/stores/style.store';
 import InputCopyable from '@/components/InputCopyable.vue';
@@ -80,7 +80,11 @@ const interval = computed(() => (now.value / 1000) % 30);
 const theme = useThemeVars();
 const styleStore = useStyleStore();
 
-const [secret, refreshSecret] = computedRefreshable(generateSecret);
+const secret = ref(generateSecret());
+
+function refreshSecret() {
+  secret.value = generateSecret();
+}
 
 const [tokens] = computedRefreshable(
   () => ({
-- 
cgit v1.2.3

