Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/subdomains/generic/kyc/services/kyc.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,9 @@ export class KycService {

async trySetMail(user: UserData, step: KycStep, mail: string): Promise<UpdateResult<KycStep>> {
try {
user = await this.userDataService.trySetUserMail(user, mail);
if (user.mail !== mail) {
await this.userDataService.trySetUserMail(user, mail);
}
return step.complete({ mail });
} catch (e) {
const error = (e as Error).message?.includes('account merge request sent')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class TransactionNotificationService {
},
relations: {
bankTx: true,
buyCrypto: true,
buyCrypto: { buy: { asset: true } },
buyFiat: true,
userData: { wallet: true },
user: { wallet: true },
Expand All @@ -59,6 +59,12 @@ export class TransactionNotificationService {
)
continue;

// Skip input mail for Bitcoin purchases that already have txId (will receive BuyCryptoCompleted mail directly)
if (entity.buyCrypto?.txId && entity.buyCrypto?.buy?.asset?.uniqueName === 'Bitcoin/BTC') {
await this.repo.update(...entity.mailSent());
continue;
}

if (entity.userData?.mail)
await this.notificationService.sendMail({
type: MailType.USER_V2,
Expand Down
Loading