Merge branch 'master' into admin-email-confirmation

This commit is contained in:
Moriz Wahl 2022-02-11 16:29:05 +01:00 committed by GitHub
commit 15a9af4552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 35 deletions

View File

@ -373,7 +373,7 @@ export class TransactionResolver {
// TODO: the detour over the public key is unnecessary
const recipiantPublicKey = await getPublicKey(email)
if (!recipiantPublicKey) {
throw new Error('recipiant not known')
throw new Error('recipient not known')
}
if (!isHexPublicKey(recipiantPublicKey)) {
throw new Error('invalid recipiant public key')

View File

@ -112,7 +112,7 @@ describe('SendOverview', () => {
describe('transaction is confirmed and server response is error', () => {
beforeEach(async () => {
jest.clearAllMocks()
sendMock.mockRejectedValue({ message: 'recipiant not known' })
sendMock.mockRejectedValue({ message: 'recipient not known' })
await wrapper
.findComponent({ name: 'TransactionConfirmation' })
.vm.$emit('send-transaction')

View File

@ -78,6 +78,7 @@ export default {
},
async sendTransaction() {
this.loading = true
this.error = false
this.$apollo
.mutate({
mutation: sendCoins,

View File

@ -1,4 +1,26 @@
<template>
<b-container>
<b-row v-if="error">
<b-col>
<b-card class="p-0" style="background-color: #ebebeba3 !important">
<div class="p-4" style="font-size: 1.5rem">
<div>{{ $t('form.sorry') }}</div>
<hr />
<div class="test-send_transaction_error">{{ $t('form.send_transaction_error') }}</div>
<hr />
<div class="test-receiver-not-found" v-if="errorResult === 'recipient not known'">
{{ $t('transaction.receiverNotFound') }}
</div>
<div v-else>({{ errorResult }})</div>
</div>
<p class="text-center mt-3">
<b-button variant="success" @click="$emit('on-reset')">{{ $t('form.close') }}</b-button>
</p>
</b-card>
</b-col>
</b-row>
<b-row v-if="!error">
<b-col>
<b-card class="p-0" style="background-color: #ebebeba3 !important">
@ -13,33 +35,13 @@
</b-card>
</b-col>
</b-row>
<b-row v-else>
<b-col>
<b-card class="p-0" style="background-color: #ebebeba3 !important">
<div class="p-4" style="font-size: 1.5rem">
<div>{{ $t('form.sorry') }}</div>
<hr />
<div class="test-send_transaction_error">{{ $t('form.send_transaction_error') }}</div>
<hr />
<div class="test-receiver-not-found" v-if="errorResult === 'recipiant not known'">
{{ $t('transaction.receiverNotFound') }}
</div>
<div v-else>({{ errorResult }})</div>
</div>
<p class="text-center mt-3">
<b-button variant="success" @click="$emit('on-reset')">{{ $t('form.close') }}</b-button>
</p>
</b-card>
</b-col>
</b-row>
</b-container>
</template>
<script>
export default {
name: 'TransactionResult',
props: {
error: { type: Boolean, default: true },
error: { type: Boolean, default: false },
errorResult: { type: String, default: '' },
},
}