diff --git a/resources/js/Pages/Vault/Contact/Show.vue b/resources/js/Pages/Vault/Contact/Show.vue index 0ad769c3cb7..f87038fc834 100644 --- a/resources/js/Pages/Vault/Contact/Show.vue +++ b/resources/js/Pages/Vault/Contact/Show.vue @@ -3,6 +3,7 @@ import { ref, reactive } from 'vue'; import { Link, router, useForm } from '@inertiajs/vue3'; import { trans } from 'laravel-vue-i18n'; import { flash } from '@/methods.js'; +import { onMounted } from 'vue'; import JetDialogModal from '@/Components/Jetstream/DialogModal.vue'; import JetConfirmationModal from '@/Components/Jetstream/ConfirmationModal.vue'; import JetButton from '@/Components/Button.vue'; @@ -151,6 +152,19 @@ const download = () => { }, }); }; + +const selectedOption = ref(''); + +onMounted(() => { + const selectedPage = Object.values(props.data.template_pages).find((page) => page.selected); + if (selectedPage) { + selectedOption.value = selectedPage.url.show; + } +}); + +const navigateToSelected = () => { + router.visit(selectedOption.value); +};