mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
mobile: fix wrong trial end date shown in settings
This commit is contained in:
@@ -143,21 +143,20 @@ export const settingsGroups: SettingSection[] = [
|
||||
"dddd, MMMM D, YYYY h:mm A"
|
||||
);
|
||||
|
||||
const trialEndDate = dayjs(user?.subscription?.start)
|
||||
.add(
|
||||
user?.subscription?.productId?.includes("monthly") ? 7 : 14,
|
||||
"day"
|
||||
)
|
||||
.format("dddd, MMMM D, YYYY h:mm A");
|
||||
|
||||
if (
|
||||
user.subscription?.plan !== SubscriptionPlan.FREE &&
|
||||
user.subscription?.productId
|
||||
) {
|
||||
const status = user.subscription?.status;
|
||||
return status === SubscriptionStatus.TRIAL
|
||||
? strings.trialEndsOn(
|
||||
dayjs(user?.subscription?.start)
|
||||
.add(
|
||||
user?.subscription?.productId?.includes("monthly")
|
||||
? 7
|
||||
: 14
|
||||
)
|
||||
.format("dddd, MMMM D, YYYY h:mm A")
|
||||
)
|
||||
? strings.trialOnGoing(trialEndDate)
|
||||
: status === SubscriptionStatus.ACTIVE
|
||||
? strings.subRenewOn(expiryDate)
|
||||
: status === SubscriptionStatus.CANCELED ||
|
||||
|
||||
@@ -7471,6 +7471,10 @@ msgstr "Your free trial has started"
|
||||
msgid "Your free trial is ending soon"
|
||||
msgstr "Your free trial is ending soon"
|
||||
|
||||
#: src/strings.ts:2614
|
||||
msgid "Your free trial is on-going. Your subscription will start on {trialExpiryDate}"
|
||||
msgstr "Your free trial is on-going. Your subscription will start on {trialExpiryDate}"
|
||||
|
||||
#: src/strings.ts:1777
|
||||
msgid "Your full name"
|
||||
msgstr "Your full name"
|
||||
|
||||
@@ -7417,6 +7417,10 @@ msgstr ""
|
||||
msgid "Your free trial is ending soon"
|
||||
msgstr ""
|
||||
|
||||
#: src/strings.ts:2614
|
||||
msgid "Your free trial is on-going. Your subscription will start on {trialExpiryDate}"
|
||||
msgstr ""
|
||||
|
||||
#: src/strings.ts:1777
|
||||
msgid "Your full name"
|
||||
msgstr ""
|
||||
|
||||
@@ -2609,5 +2609,7 @@ Use this if changes from other devices are not appearing on this device. This wi
|
||||
views: () => t`Views`,
|
||||
clickToUpdate: () => t`Click to update`,
|
||||
noPassword: () => t`No password`,
|
||||
publishToTheWeb: () => t`Publish to the web`
|
||||
publishToTheWeb: () => t`Publish to the web`,
|
||||
trialOnGoing: (trialExpiryDate: string) =>
|
||||
t`Your free trial is on-going. Your subscription will start on ${trialExpiryDate}`
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user