Skip to content

Commit eab8e4b

Browse files
author
Nick Menke
committed
1 parent f410dcf commit eab8e4b

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

resources/js/components/TwoFactorRecoveryCodes.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// packages
33
import { Form } from '@inertiajs/vue3';
44
import { Eye, EyeOff, LockKeyhole, RefreshCw } from 'lucide-vue-next';
5-
import { nextTick, onMounted, ref } from 'vue';
5+
import { nextTick, onMounted, ref, useTemplateRef } from 'vue';
66
// shadcn ui
77
import { Button } from '@/components/ui/button';
88
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
@@ -14,7 +14,7 @@ import { useTwoFactorAuth } from '@/composables/useTwoFactorAuth';
1414
1515
const { recoveryCodesList, fetchRecoveryCodes, errors } = useTwoFactorAuth();
1616
const isRecoveryCodesVisible = ref<boolean>(false);
17-
const recoveryCodeSectionRef = ref<HTMLDivElement | null>(null);
17+
const recoveryCodeSectionRef = useTemplateRef('recoveryCodeSectionRef');
1818
1919
const toggleRecoveryCodesVisibility = async () => {
2020
if (!isRecoveryCodesVisible.value && !recoveryCodesList.value.length) {

resources/js/components/TwoFactorSetupModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { Form } from '@inertiajs/vue3';
44
import { useClipboard } from '@vueuse/core';
55
import { Check, Copy, ScanLine } from 'lucide-vue-next';
6-
import { computed, nextTick, ref, watch } from 'vue';
6+
import { computed, nextTick, ref, useTemplateRef, watch } from 'vue';
77
// shadcn ui
88
import { Button } from '@/components/ui/button';
99
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog';
@@ -31,7 +31,7 @@ const showVerificationStep = ref(false);
3131
const code = ref<number[]>([]);
3232
const codeValue = computed<string>(() => code.value.join(''));
3333
34-
const pinInputContainerRef = ref<HTMLElement | null>(null);
34+
const pinInputContainerRef = useTemplateRef('pinInputContainerRef');
3535
3636
const modalConfig = computed<{
3737
title: string;

resources/js/components/users/DeleteUser.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
// packages
33
import { Form } from '@inertiajs/vue3';
4-
import { ref } from 'vue';
4+
import { useTemplateRef } from 'vue';
55
// shadcn ui
66
import { Button } from '@/components/ui/button';
77
import {
@@ -22,7 +22,7 @@ import ProfileController from '@/actions/App/Http/Controllers/Settings/ProfileCo
2222
import HeadingSmall from '@/components/HeadingSmall.vue';
2323
import InputError from '@/components/InputError.vue';
2424
25-
const passwordInput = ref<InstanceType<typeof Input> | null>(null);
25+
const passwordInput = useTemplateRef('passwordInput');
2626
</script>
2727

2828
<template>

resources/js/pages/settings/Password.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script setup lang="ts">
22
// packages
33
import { Form, Head } from '@inertiajs/vue3';
4-
import { ref } from 'vue';
54
// shadcn ui
65
import { Button } from '@/components/ui/button';
76
import { Input } from '@/components/ui/input';
@@ -22,9 +21,6 @@ const breadcrumbs: BreadcrumbItem[] = [
2221
href: edit(),
2322
},
2423
];
25-
26-
const passwordInput = ref<HTMLInputElement | null>(null);
27-
const currentPasswordInput = ref<HTMLInputElement | null>(null);
2824
</script>
2925

3026
<template>
@@ -52,7 +48,6 @@ const currentPasswordInput = ref<HTMLInputElement | null>(null);
5248
<Label for="current_password">Current password</Label>
5349
<Input
5450
id="current_password"
55-
ref="currentPasswordInput"
5651
name="current_password"
5752
type="password"
5853
class="mt-1 block w-full"
@@ -66,7 +61,6 @@ const currentPasswordInput = ref<HTMLInputElement | null>(null);
6661
<Label for="password">New password</Label>
6762
<Input
6863
id="password"
69-
ref="passwordInput"
7064
name="password"
7165
type="password"
7266
class="mt-1 block w-full"

0 commit comments

Comments
 (0)