Skip to content

Commit c623458

Browse files
committed
Merge branch 'fix/otp-storage' into chore/all-my-stuffs
2 parents 44b8c16 + fdb2bff commit c623458

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ import TokenDisplay from './token-display.vue';
77
import { useStyleStore } from '@/stores/style.store';
88
import InputCopyable from '@/components/InputCopyable.vue';
99
import { computedRefreshable } from '@/composable/computedRefreshable';
10+
import { useQueryParamOrStorage } from '@/composable/queryParams';
1011
1112
const now = useTimestamp();
1213
const interval = computed(() => (now.value / 1000) % 30);
1314
const theme = useThemeVars();
1415
const styleStore = useStyleStore();
1516
16-
const secret = ref(generateSecret());
17+
const secret = useQueryParamOrStorage({
18+
name: 'secret',
19+
storageName: 'otp-gen:secret',
20+
defaultValue: generateSecret(),
21+
});
1722
1823
function refreshSecret() {
1924
secret.value = generateSecret();

0 commit comments

Comments
 (0)