From 8ab14bee42776f129afec99b0a6d612e20c46952 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 5 Apr 2023 13:38:46 +0200 Subject: [PATCH 1/2] fix(frontend): reset button send coins --- frontend/src/components/GddSend/TransactionForm.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: { From fa84c210927ca460f4a06e5fa3ed879a139e10b7 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 5 Apr 2023 14:43:23 +0200 Subject: [PATCH 2/2] fix double routing with await --- frontend/src/components/TransactionRows/Name.spec.js | 8 +++----- frontend/src/components/TransactionRows/Name.vue | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) 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 } }) }, },