From a243ab817f30e373b0197b2c4763f5a6e49f0a64 Mon Sep 17 00:00:00 2001 From: Filippo Date: Sat, 5 Oct 2024 12:00:50 +0200 Subject: [PATCH] fix: incentive email mistakenly showing --- electron | 2 +- ionic/src/models/request.model.ts | 16 +++++++++------- ionic/src/pages/home/home.ts | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/electron b/electron index 94eace8d..251ab65a 160000 --- a/electron +++ b/electron @@ -1 +1 @@ -Subproject commit 94eace8d29554508023ac611352ad5f5e316da20 +Subproject commit 251ab65a71a262dbda4f13da8f679a85212d1158 diff --git a/ionic/src/models/request.model.ts b/ionic/src/models/request.model.ts index 29c01278..fa4237d6 100644 --- a/ionic/src/models/request.model.ts +++ b/ionic/src/models/request.model.ts @@ -61,13 +61,15 @@ export class requestModelHelo extends requestModel { export class requestModelEmailIncentiveCompleted extends requestModel { - action = requestModel.ACTION_EMAIL_INCENTIVE_COMPLETED; - email: string; - - public fromObject(obj: ({ email: string })) { - this.email = obj.email; - return this; - } + action = requestModel.ACTION_EMAIL_INCENTIVE_COMPLETED; + email: string; + name: string; + + public fromObject(obj: ({ email: string, name: string })) { + this.email = obj.email; + this.name = obj.name; + return this; + } } export class requestModelPutScanSessions extends requestModel { diff --git a/ionic/src/pages/home/home.ts b/ionic/src/pages/home/home.ts index 65216299..f792498d 100644 --- a/ionic/src/pages/home/home.ts +++ b/ionic/src/pages/home/home.ts @@ -254,7 +254,7 @@ export class HomePage { // this.licenseProvider.limitMonthlyScans(finalNoScans - initialNoScans); const currentCount = await this.licenseProvider.limitMonthlyScans(1); - if (!localStorage.getItem('email') && currentCount > Config.INCENTIVE_EMAIL_SHOW_THRESHOLD) { + if (!localStorage.getItem('email') && currentCount > Config.INCENTIVE_EMAIL_SHOW_THRESHOLD && this.licenseProvider.activeLicense === LicenseProvider.LICENSE_FREE) { this.electronProvider.ipcRenderer.send('ipc_show_incentive_email_alert', currentCount); }