@@ -16,13 +16,14 @@ import { InputGroup, Button, SettingsHeadline } from '../../UI';
16
16
import { otherSettingsTemplate , inputHandler } from '../../../utility' ;
17
17
18
18
export const UISettings = ( ) : JSX . Element => {
19
- const { loading, config } = useSelector ( ( state : State ) => state . config ) ;
19
+ const {
20
+ config : { loading, config } ,
21
+ bookmarks : { categories } ,
22
+ } = useSelector ( ( state : State ) => state ) ;
20
23
21
24
const dispatch = useDispatch ( ) ;
22
- const { updateConfig, sortApps, sortCategories } = bindActionCreators (
23
- actionCreators ,
24
- dispatch
25
- ) ;
25
+ const { updateConfig, sortApps, sortCategories, sortBookmarks } =
26
+ bindActionCreators ( actionCreators , dispatch ) ;
26
27
27
28
// Initial state
28
29
const [ formData , setFormData ] = useState < OtherSettingsForm > (
@@ -46,9 +47,15 @@ export const UISettings = (): JSX.Element => {
46
47
// Update local page title
47
48
document . title = formData . customTitle ;
48
49
49
- // Sort apps and categories with new settings
50
- sortApps ( ) ;
51
- sortCategories ( ) ;
50
+ // Sort entities with new settings
51
+ if ( formData . useOrdering !== config . useOrdering ) {
52
+ sortApps ( ) ;
53
+ sortCategories ( ) ;
54
+
55
+ for ( let { id } of categories ) {
56
+ sortBookmarks ( id ) ;
57
+ }
58
+ }
52
59
} ;
53
60
54
61
// Input handler
0 commit comments