mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-10 06:23:11 +08:00
Fixed bug with alphabetical order not working for bookmarks. Minor changes related to bookmarks form
This commit is contained in:
@@ -16,13 +16,14 @@ import { InputGroup, Button, SettingsHeadline } from '../../UI';
|
||||
import { otherSettingsTemplate, inputHandler } from '../../../utility';
|
||||
|
||||
export const UISettings = (): JSX.Element => {
|
||||
const { loading, config } = useSelector((state: State) => state.config);
|
||||
const {
|
||||
config: { loading, config },
|
||||
bookmarks: { categories },
|
||||
} = useSelector((state: State) => state);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const { updateConfig, sortApps, sortCategories } = bindActionCreators(
|
||||
actionCreators,
|
||||
dispatch
|
||||
);
|
||||
const { updateConfig, sortApps, sortCategories, sortBookmarks } =
|
||||
bindActionCreators(actionCreators, dispatch);
|
||||
|
||||
// Initial state
|
||||
const [formData, setFormData] = useState<OtherSettingsForm>(
|
||||
@@ -46,9 +47,15 @@ export const UISettings = (): JSX.Element => {
|
||||
// Update local page title
|
||||
document.title = formData.customTitle;
|
||||
|
||||
// Sort apps and categories with new settings
|
||||
sortApps();
|
||||
sortCategories();
|
||||
// Sort entities with new settings
|
||||
if (formData.useOrdering !== config.useOrdering) {
|
||||
sortApps();
|
||||
sortCategories();
|
||||
|
||||
for (let { id } of categories) {
|
||||
sortBookmarks(id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Input handler
|
||||
|
||||
Reference in New Issue
Block a user