Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix trial ending dialog showing everytime

ammarahm-ed006a1d32c475
diff --git a/apps/mobile/src/services/PremiumService.js b/apps/mobile/src/services/PremiumService.js
index 520bdfb73..f2aa2bf41 100644
--- a/apps/mobile/src/services/PremiumService.js
+++ b/apps/mobile/src/services/PremiumService.js
@@ -282,13 +282,14 @@ async function getRemainingTrialDaysStatus() {
let user = await db.user.getUser();
if (!user) return;
let premium = user.subscription.type !== SUBSCRIPTION_STATUS.BASIC;
+ let isTrial = user.subscription.type === SUBSCRIPTION_STATUS.TRIAL;
let total = user.subscription.expiry - user.subscription.start;
let current = Date.now() - user.subscription.start;
current = (current / total) * 100;
console.log(current);
let lastTrialDialogShownAt = await MMKV.getItem('lastTrialDialogShownAt');
- if (current > 75 && lastTrialDialogShownAt !== 'ending') {
+ if (current > 75 && isTrial && lastTrialDialogShownAt !== 'ending') {
eSendEvent(eOpenTrialEndingDialog, {
title: 'Your trial is ending soon',
offer: null,