Skip to content

Commit ab44227

Browse files
committed
Updates time remaining text on home view
1 parent 64e031a commit ab44227

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/webviews/apps/home/home.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ export class HomeApp extends App<State> {
101101
const remaining = getSubscriptionTimeRemaining(subscription, 'days') ?? 0;
102102
DOM.insertTemplate('state:free-preview', this.$slots[index++], {
103103
bindings: {
104-
previewDays: `${remaining === 1 ? `${remaining} day` : `${remaining} days`}`,
104+
previewDays: `${
105+
remaining < 1
106+
? 'less than one day'
107+
: remaining === 1
108+
? `${remaining} day`
109+
: `${remaining} days`
110+
}`,
105111
},
106112
});
107113

@@ -124,7 +130,13 @@ export class HomeApp extends App<State> {
124130
DOM.insertTemplate('state:plus-trial', this.$slots[index++], {
125131
bindings: {
126132
plan: subscription.plan.effective.name,
127-
trialDays: `${remaining === 1 ? `${remaining} day` : `${remaining} days`}`,
133+
trialDays: `${
134+
remaining < 1
135+
? 'less than one day'
136+
: remaining === 1
137+
? `${remaining} day`
138+
: `${remaining} days`
139+
}`,
128140
},
129141
});
130142

0 commit comments

Comments
 (0)