Skip to content

Commit 9782812

Browse files
committed
refactor: remove custom useClipboard composable
1 parent 9317296 commit 9782812

File tree

2 files changed

+4
-37
lines changed

2 files changed

+4
-37
lines changed

resources/js/components/TwoFactorSetupModal.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import InputError from '@/components/InputError.vue';
33
import { Button } from '@/components/ui/button';
44
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog';
55
import { PinInput, PinInputGroup, PinInputSlot } from '@/components/ui/pin-input';
6-
import { useClipboard } from '@/composables/useClipboard';
76
import { useTwoFactorAuth } from '@/composables/useTwoFactorAuth';
87
import { Form } from '@inertiajs/vue3';
8+
import { useClipboard } from '@vueuse/core';
99
import { Check, Copy, Loader2, ScanLine } from 'lucide-vue-next';
1010
import { computed, nextTick, ref, watch } from 'vue';
1111
@@ -22,7 +22,7 @@ interface Emits {
2222
const props = defineProps<Props>();
2323
const emit = defineEmits<Emits>();
2424
25-
const { recentlyCopied, copyToClipboard } = useClipboard();
25+
const { copy, copied } = useClipboard();
2626
const { qrCodeSvg, manualSetupKey, fetchSetupData } = useTwoFactorAuth();
2727
2828
const showVerificationStep = ref(false);
@@ -133,11 +133,8 @@ watch(
133133
</div>
134134
<template v-else>
135135
<input type="text" readonly :value="manualSetupKey" class="h-full w-full bg-background p-3 text-foreground" />
136-
<button
137-
@click="copyToClipboard(manualSetupKey || '')"
138-
class="relative block h-auto border-l border-border px-3 hover:bg-muted"
139-
>
140-
<Check v-if="recentlyCopied" class="w-4 text-green-500" />
136+
<button @click="copy(manualSetupKey || '')" class="relative block h-auto border-l border-border px-3 hover:bg-muted">
137+
<Check v-if="copied" class="w-4 text-green-500" />
141138
<Copy v-else class="w-4" />
142139
</button>
143140
</template>

resources/js/composables/useClipboard.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)