diff --git a/frontend/src/components/GddSend/TransactionForm.vue b/frontend/src/components/GddSend/TransactionForm.vue index 7d2a0aae4..fae2e044a 100644 --- a/frontend/src/components/GddSend/TransactionForm.vue +++ b/frontend/src/components/GddSend/TransactionForm.vue @@ -130,6 +130,7 @@ import InputEmail from '@/components/Inputs/InputEmail' import InputAmount from '@/components/Inputs/InputAmount' import InputTextarea from '@/components/Inputs/InputTextarea' import { user as userQuery } from '@/graphql/queries' +import { isEmpty } from 'lodash' export default { name: 'TransactionForm', @@ -176,7 +177,8 @@ export default { this.form.amount = '' this.form.memo = '' this.$refs.formValidator.validate() - if (this.$route.query && !this.$route.query === {}) this.$router.replace({ query: undefined }) + if (this.$route.query && !isEmpty(this.$route.query)) + this.$router.replace({ query: undefined }) }, }, apollo: { diff --git a/frontend/src/components/TransactionRows/Name.spec.js b/frontend/src/components/TransactionRows/Name.spec.js index 2c370bafc..99e586fde 100644 --- a/frontend/src/components/TransactionRows/Name.spec.js +++ b/frontend/src/components/TransactionRows/Name.spec.js @@ -8,11 +8,9 @@ const routerPushMock = jest.fn() const mocks = { $router: { push: routerPushMock, - history: { - current: { - fullPath: '/transactions', - }, - }, + }, + $route: { + path: '/transactions', }, } diff --git a/frontend/src/components/TransactionRows/Name.vue b/frontend/src/components/TransactionRows/Name.vue index 8695645d8..b4ddfc849 100644 --- a/frontend/src/components/TransactionRows/Name.vue +++ b/frontend/src/components/TransactionRows/Name.vue @@ -34,8 +34,8 @@ export default { }, }, methods: { - tunnelEmail() { - if (this.$router.history.current.fullPath !== '/send') this.$router.push({ path: '/send' }) + async tunnelEmail() { + if (this.$route.path !== '/send') await this.$router.push({ path: '/send' }) this.$router.push({ query: { gradidoID: this.linkedUser.gradidoID } }) }, },