mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-17 16:37:43 +00:00
fix(finish-day): open daily summary from before-close dialog (#8449)
The before-close confirm dialog's 'Finish Day' option navigated to a bare '/daily-summary' route, which does not exist at the top level. It fell through to the '**' wildcard and redirected to the start page, so the daily summary never opened and the app appeared to do nothing. Navigate to '/active/daily-summary' instead — resolved by ActiveWorkContextGuard to the current context, matching the in-app Finish Day button.
This commit is contained in:
parent
9b35c30f9c
commit
07d3e1d722
2 changed files with 11 additions and 3 deletions
|
|
@ -99,12 +99,14 @@ describe('FinishDayBeforeCloseEffects._handleCloseDecision()', () => {
|
|||
expect(router.navigateByUrl).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('navigates to /daily-summary and does NOT close when user picks "finish-day"', async () => {
|
||||
it('navigates to /active/daily-summary and does NOT close when user picks "finish-day"', async () => {
|
||||
showDialogSpy.and.returnValue(Promise.resolve('finish-day'));
|
||||
|
||||
await effects._handleCloseDecision([doneTask, undoneTask]);
|
||||
|
||||
expect(router.navigateByUrl).toHaveBeenCalledWith('/daily-summary');
|
||||
// Must target the context-resolved route (issue #8449); a bare
|
||||
// `/daily-summary` has no matching route and redirects to the start page.
|
||||
expect(router.navigateByUrl).toHaveBeenCalledWith('/active/daily-summary');
|
||||
expect(execBeforeCloseService.setDone).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -103,7 +103,13 @@ export class FinishDayBeforeCloseEffects {
|
|||
if (choice === 'quit') {
|
||||
this._execBeforeCloseService.setDone(EXEC_BEFORE_CLOSE_ID);
|
||||
} else if (choice === 'finish-day') {
|
||||
this._router.navigateByUrl('/daily-summary');
|
||||
// There is no top-level `/daily-summary` route — the daily summary only
|
||||
// exists under the active work context (tag/project). `/active/...` is
|
||||
// resolved by ActiveWorkContextGuard to the current context, same as the
|
||||
// in-app Finish Day button. A bare `/daily-summary` falls through to the
|
||||
// `**` wildcard and redirects to the start page, so the summary never
|
||||
// opens (issue #8449).
|
||||
this._router.navigateByUrl('/active/daily-summary');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue