From fa84c210927ca460f4a06e5fa3ed879a139e10b7 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 5 Apr 2023 14:43:23 +0200 Subject: [PATCH] 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 } }) }, },