Skip to content

Commit bd9d78f

Browse files
committed
Fix Text Jarring Issue
1 parent 48e7b90 commit bd9d78f

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed

resources/js/components/TwoFactorRecoveryCodes.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ onMounted(async () => {
5454
@success="fetchRecoveryCodes"
5555
#default="{ processing }"
5656
>
57-
<Button variant="secondary" type="submit" :disabled="processing">
58-
<RefreshCw class="mr-2 size-4" :class="{ 'animate-spin': processing }" />
59-
{{ processing ? 'Regenerating...' : 'Regenerate Codes' }}
60-
</Button>
57+
<Button variant="secondary" type="submit" :disabled="processing"> <RefreshCw /> Regenerate Codes </Button>
6158
</Form>
6259
</div>
6360
<div :class="['relative overflow-hidden transition-all duration-300', isRecoveryCodesVisible ? 'h-auto opacity-100' : 'h-0 opacity-0']">

resources/js/components/TwoFactorSetupModal.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ watch(
177177
>
178178
Back
179179
</Button>
180-
<Button type="submit" class="w-auto flex-1" :disabled="processing || codeValue.length < 6">
181-
{{ processing ? 'Confirming...' : 'Confirm' }}
182-
</Button>
180+
<Button type="submit" class="w-auto flex-1" :disabled="processing || codeValue.length < 6"> Confirm </Button>
183181
</div>
184182
</div>
185183
</Form>

resources/js/composables/useTwoFactorAuth.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { qrCode, recoveryCodes, secretKey } from '@/routes/two-factor';
2-
import { computed, ref } from 'vue';
2+
import { ref } from 'vue';
33

44
const fetchJson = async <T>(url: string): Promise<T> => {
55
const response = await fetch(url, {
@@ -17,8 +17,6 @@ const qrCodeSvg = ref<string | null>(null);
1717
const manualSetupKey = ref<string | null>(null);
1818
const recoveryCodesList = ref<string[]>([]);
1919

20-
const hasSetupData = computed<boolean>(() => qrCodeSvg.value !== null && manualSetupKey.value !== null);
21-
2220
export const useTwoFactorAuth = () => {
2321
const fetchQrCode = async (): Promise<void> => {
2422
const { svg } = await fetchJson<{ svg: string; url: string }>(qrCode.url());
@@ -63,7 +61,6 @@ export const useTwoFactorAuth = () => {
6361
qrCodeSvg,
6462
manualSetupKey,
6563
recoveryCodesList,
66-
hasSetupData,
6764
clearSetupData,
6865
clearTwoFactorAuthData,
6966
fetchQrCode,

resources/js/pages/settings/TwoFactor.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const breadcrumbs: BreadcrumbItem[] = [
3030
},
3131
];
3232
33-
const { hasSetupData, clearTwoFactorAuthData } = useTwoFactorAuth();
33+
const { clearTwoFactorAuthData } = useTwoFactorAuth();
3434
const showSetupModal = ref<boolean>(false);
3535
3636
onUnmounted(() => {
@@ -54,9 +54,8 @@ onUnmounted(() => {
5454
</p>
5555

5656
<div>
57-
<Button v-if="hasSetupData" @click="showSetupModal = true"> <ShieldCheck />Continue Setup </Button>
58-
<Form v-else v-bind="enable.form()" @success="showSetupModal = true" #default="{ processing }">
59-
<Button type="submit" :disabled="processing"> <ShieldCheck />{{ processing ? 'Enabling...' : 'Enable 2FA' }} </Button>
57+
<Form v-bind="enable.form()" @success="showSetupModal = true" #default="{ processing }">
58+
<Button type="submit" :disabled="processing"> <ShieldCheck />Enable 2FA</Button>
6059
</Form>
6160
</div>
6261
</div>
@@ -75,7 +74,7 @@ onUnmounted(() => {
7574
<Form v-bind="disable.form()" #default="{ processing }">
7675
<Button variant="destructive" type="submit" :disabled="processing">
7776
<ShieldBan />
78-
{{ processing ? 'Disabling...' : 'Disable 2FA' }}
77+
Disable 2FA
7978
</Button>
8079
</Form>
8180
</div>

0 commit comments

Comments
 (0)