From e61a6558bd8516edf66798c0a4df3f4aaf780c91 Mon Sep 17 00:00:00 2001 From: Fabio101 Date: Sun, 28 Mar 2021 13:51:07 +0400 Subject: [PATCH 1/2] Fix Bootstrap is not defined on 2FA modal --- stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue b/stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue index 94bb8b3..0c3571b 100644 --- a/stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue +++ b/stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue @@ -82,13 +82,13 @@ methods: { startConfirmingPassword() { this.form.error = ''; - this.modal = new Bootstrap.Modal(document.getElementById('confirmingPasswordModal')) + this.modal = $('#confirmingPasswordModal'); axios.get(route('password.confirmation')).then(response => { if (response.data.confirmed) { this.$emit('confirmed'); } else { - this.modal.show() + this.modal.modal('toggle'); this.form.password = ''; setTimeout(() => { @@ -104,7 +104,7 @@ axios.post(route('password.confirm'), { password: this.form.password, }).then(response => { - this.modal.hide() + this.modal.modal('hide'); this.form.password = ''; this.form.error = ''; this.form.processing = false; From d653d9e6814cf837918e4a399e717b1357074a13 Mon Sep 17 00:00:00 2001 From: Fabio101 Date: Mon, 29 Mar 2021 08:34:57 +0400 Subject: [PATCH 2/2] Using more appropriate var name --- stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue b/stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue index 0c3571b..78d121f 100644 --- a/stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue +++ b/stubs/inertia/resources/js/Jetstream/ConfirmsPassword.vue @@ -68,7 +68,7 @@ data() { return { - modal: null, + bootstrap: null, form: this.$inertia.form({ password: '', @@ -82,13 +82,13 @@ methods: { startConfirmingPassword() { this.form.error = ''; - this.modal = $('#confirmingPasswordModal'); + this.bootstrap = $('#confirmingPasswordModal'); axios.get(route('password.confirmation')).then(response => { if (response.data.confirmed) { this.$emit('confirmed'); } else { - this.modal.modal('toggle'); + this.bootstrap.modal('toggle'); this.form.password = ''; setTimeout(() => { @@ -104,7 +104,7 @@ axios.post(route('password.confirm'), { password: this.form.password, }).then(response => { - this.modal.modal('hide'); + this.bootstrap.modal('hide'); this.form.password = ''; this.form.error = ''; this.form.processing = false;