mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-27 06:49:37 +02:00
Fixed bug with alphabetical order not working for bookmarks. Minor changes related to bookmarks form
This commit is contained in:
parent
ec5f50aba4
commit
d5610ad6be
12 changed files with 89 additions and 17 deletions
|
@ -69,7 +69,7 @@ export const Bookmarks = (props: Props): JSX.Element => {
|
|||
}, [isAuthenticated]);
|
||||
|
||||
useEffect(() => {
|
||||
if (categoryInEdit) {
|
||||
if (categoryInEdit && !modalIsOpen) {
|
||||
setTableContentType(ContentType.bookmark);
|
||||
setShowTable(true);
|
||||
}
|
||||
|
|
|
@ -137,11 +137,11 @@ export const BookmarksForm = ({
|
|||
}
|
||||
|
||||
modalHandler();
|
||||
|
||||
setFormData(newBookmarkTemplate);
|
||||
|
||||
setCustomIcon(null);
|
||||
}
|
||||
|
||||
setFormData(newBookmarkTemplate);
|
||||
|
||||
setCustomIcon(null);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -60,10 +60,10 @@ export const CategoryForm = ({
|
|||
addCategory(formData);
|
||||
} else {
|
||||
updateCategory(category.id, formData);
|
||||
modalHandler();
|
||||
}
|
||||
|
||||
setFormData(newCategoryTemplate);
|
||||
modalHandler();
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue