Skip to content

Commit bf72a21

Browse files
authored
Merge pull request #2944 from DFXswiss/develop
Release: develop -> main
2 parents 42e7c85 + 01ad0f1 commit bf72a21

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/subdomains/generic/kyc/services/kyc.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,9 @@ export class KycService {
11701170

11711171
async trySetMail(user: UserData, step: KycStep, mail: string): Promise<UpdateResult<KycStep>> {
11721172
try {
1173-
user = await this.userDataService.trySetUserMail(user, mail);
1173+
if (user.mail !== mail) {
1174+
await this.userDataService.trySetUserMail(user, mail);
1175+
}
11741176
return step.complete({ mail });
11751177
} catch (e) {
11761178
const error = (e as Error).message?.includes('account merge request sent')

src/subdomains/supporting/payment/services/transaction-notification.service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class TransactionNotificationService {
4343
},
4444
relations: {
4545
bankTx: true,
46-
buyCrypto: true,
46+
buyCrypto: { buy: { asset: true } },
4747
buyFiat: true,
4848
userData: { wallet: true },
4949
user: { wallet: true },
@@ -59,6 +59,12 @@ export class TransactionNotificationService {
5959
)
6060
continue;
6161

62+
// Skip input mail for Bitcoin purchases that already have txId (will receive BuyCryptoCompleted mail directly)
63+
if (entity.buyCrypto?.txId && entity.buyCrypto?.buy?.asset?.uniqueName === 'Bitcoin/BTC') {
64+
await this.repo.update(...entity.mailSent());
65+
continue;
66+
}
67+
6268
if (entity.userData?.mail)
6369
await this.notificationService.sendMail({
6470
type: MailType.USER_V2,

0 commit comments

Comments
 (0)