@@ -53,6 +53,7 @@ const OneList = () => {
5353 const oneListRec = getListRec ( listID , state ) ;
5454 if ( oneListRec === null ) { needsRedirect = true ; } // this will happen after record deletion
5555 if ( needsRedirect ) { return ( < Redirect to = "/" /> ) ; } // back to main page if no ID
56+ const isFlatMode = getFlatMode2 ( state ) ;
5657 const showLoading = state . loading ;
5758 const showLogin = ! state . loading && ! state . loggedIn ;
5859 const showMain = ! state . loading && state . loggedIn ;
@@ -92,10 +93,15 @@ const OneList = () => {
9293 // setAddMode(!getMobile(state));
9394 // }, [state.isMobile]);
9495
96+ // go to parent category page after deletion, or top page if in flat mode
9597 const removeList = async ( ) => {
9698 const status = await handleRemoveList ( listID , state , dispatch ) ;
9799 if ( status === api . OK ) {
98- if ( parentCatID != null ) history . push ( '/cat/' , { categoryID :parentCatID } ) ;
100+ if ( isFlatMode ) {
101+ history . push ( '/' ) ;
102+ } else {
103+ if ( parentCatID != null ) history . push ( '/cat/' , { categoryID :parentCatID } ) ;
104+ }
99105 }
100106 } ;
101107
@@ -104,7 +110,6 @@ const OneList = () => {
104110 * flat mode or category mode.
105111 */
106112 const crumbArea = ( ) => {
107- const isFlatMode = getFlatMode2 ( state ) ;
108113 return (
109114 < Fragment >
110115 < div className = 'crumbsplustwo' >
0 commit comments