Skip to content

Commit bf928c2

Browse files
committed
Shorten upcoming event title
1 parent 032811b commit bf928c2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/stores/calendar.store.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,12 @@ export const createCalendarStore = (root: IRootStore) => {
155155
const lStart = DateTime.fromISO(upcomingEvent.date)
156156
const minutes = lStart.diffNow('minutes').minutes
157157

158+
const title = `${upcomingEvent.title!.trim().substring(0, 18)}${
159+
upcomingEvent.title!.length > 18 ? '...' : ''
160+
}`
161+
158162
if (minutes <= 0) {
159-
solNative.setStatusBarItemTitle(upcomingEvent.title?.trim() ?? '')
163+
solNative.setStatusBarItemTitle(title)
160164
return
161165
}
162166

@@ -167,9 +171,7 @@ export const createCalendarStore = (root: IRootStore) => {
167171
)}m`
168172

169173
solNative.setStatusBarItemTitle(
170-
`${upcomingEvent.title!.trim().substring(0, 18)}${
171-
upcomingEvent.title!.length > 18 ? '...' : ''
172-
}${relativeHoursStr} ${relativeMinutesStr}`,
174+
`${title}${relativeHoursStr} ${relativeMinutesStr}`,
173175
)
174176
})
175177
},

0 commit comments

Comments
 (0)