(state: PomodoroState)
| 1160 | } |
| 1161 | |
| 1162 | private updateSessionMeta(state: PomodoroState): void { |
| 1163 | if (!this.sessionMetaDisplay) { |
| 1164 | return; |
| 1165 | } |
| 1166 | |
| 1167 | const formattedTime = formatPomodoroTime(state.timeRemaining, { padMinutes: false }); |
| 1168 | let text: string; |
| 1169 | |
| 1170 | if (state.currentSession) { |
| 1171 | const sessionLabel = this.getSessionTypeLabel(state.currentSession.type); |
| 1172 | if (state.isRunning) { |
| 1173 | const projectedEndTime = formatTime( |
| 1174 | new Date(getProjectedPomodoroEndTimeMs(state.timeRemaining)), |
| 1175 | this.plugin.settings.calendarViewSettings.timeFormat |
| 1176 | ); |
| 1177 | text = this.t("views.pomodoro.meta.running", { |
| 1178 | time: formattedTime, |
| 1179 | endTime: projectedEndTime, |
| 1180 | }); |
| 1181 | } else { |
| 1182 | text = this.t("views.pomodoro.meta.paused", { |
| 1183 | type: sessionLabel, |
| 1184 | time: formattedTime, |
| 1185 | }); |
| 1186 | } |
| 1187 | } else if ( |
| 1188 | state.nextSessionType === "short-break" || |
| 1189 | state.nextSessionType === "long-break" |
| 1190 | ) { |
| 1191 | text = this.t("views.pomodoro.meta.breakReady", { |
| 1192 | type: this.getSessionTypeLabel(state.nextSessionType), |
| 1193 | time: formattedTime, |
| 1194 | }); |
| 1195 | } else { |
| 1196 | text = this.t("views.pomodoro.meta.ready", { |
| 1197 | time: formattedTime, |
| 1198 | count: this.todaysPomodoros, |
| 1199 | }); |
| 1200 | } |
| 1201 | |
| 1202 | this.sessionMetaDisplay.textContent = text; |
| 1203 | } |
| 1204 | |
| 1205 | private getSessionTypeLabel(type: PomodoroSession["type"]): string { |
| 1206 | if (type === "work") { |
no test coverage detected