mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-26 00:55:16 -07:00
Fix CodeRabbit review feedback
This commit is contained in:
@@ -219,7 +219,7 @@ test('confirmDayGroupDelete uses singular for one session', async () => {
|
||||
|
||||
try {
|
||||
assert.equal(await confirmDayGroupDelete('Yesterday', 1), true);
|
||||
assert.deepEqual(calls, ['Delete all 1 session from Yesterday and all associated data?']);
|
||||
assert.deepEqual(calls, ['Delete this session from Yesterday and all associated data?']);
|
||||
} finally {
|
||||
globalThis.confirm = originalConfirm;
|
||||
}
|
||||
|
||||
@@ -44,8 +44,13 @@ export function confirmSessionDelete(): Promise<boolean> {
|
||||
}
|
||||
|
||||
export function confirmDayGroupDelete(dayLabel: string, count: number): Promise<boolean> {
|
||||
if (count === 1) {
|
||||
return confirmWithStatsNativeDialogLayer(
|
||||
`Delete this session from ${dayLabel} and all associated data?`,
|
||||
);
|
||||
}
|
||||
return confirmWithStatsNativeDialogLayer(
|
||||
`Delete all ${count} session${count === 1 ? '' : 's'} from ${dayLabel} and all associated data?`,
|
||||
`Delete all ${count} sessions from ${dayLabel} and all associated data?`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user