diff --git a/commafeed-client/src/app/tree/thunks.ts b/commafeed-client/src/app/tree/thunks.ts index ac0d7a33..1ea66fb1 100644 --- a/commafeed-client/src/app/tree/thunks.ts +++ b/commafeed-client/src/app/tree/thunks.ts @@ -1,5 +1,6 @@ import { createAppAsyncThunk } from "app/async-thunk" import { client } from "app/client" +import { Constants } from "app/constants" import { redirectToCategory, redirectToFeed } from "app/redirect/thunks" import { incrementUnreadCount } from "app/tree/slice" import type { CollapseRequest, Subscription } from "app/types" @@ -53,6 +54,9 @@ export const selectNextUnreadTreeItem = createAppAsyncThunk( } } } + + // redirect to 'all' if no unread categories or feeds found or if we reached the end of the list + thunkApi.dispatch(redirectToCategory(Constants.categories.all.id)) } )