Commit f5823cf 1 parent b8599a7 commit f5823cf Copy full SHA for f5823cf
File tree 2 files changed +2
-3
lines changed
2 files changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,8 @@ const TodoList = () => {
18
18
query : { todoListId } ,
19
19
} = useRouter ( ) ;
20
20
21
- useBackButton ( '/' ) ;
22
-
23
21
const { data, isLoading } = useTodoList ( todoListId as string ) ;
22
+ useBackButton ( ! ! data ? `/category/${ data . categoryId } ` : '/' ) ;
24
23
const { open } = usePopup ( ) ;
25
24
const { t } = useTranslation ( ) ;
26
25
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { useRouter } from 'next/router';
5
5
6
6
export const useTranslation = ( ) => {
7
7
const { locale } = useRouter ( ) ;
8
- const translation = translations [ locale as Locales ] ;
8
+ const translation = translations [ ( locale || 'en' ) as Locales ] ;
9
9
10
10
const translator = (
11
11
key : keyof typeof translation ,
You can’t perform that action at this time.
0 commit comments