diff --git a/client/src/components/Apps/Apps.tsx b/client/src/components/Apps/Apps.tsx index c7718da..e5767fa 100644 --- a/client/src/components/Apps/Apps.tsx +++ b/client/src/components/Apps/Apps.tsx @@ -25,7 +25,7 @@ interface ComponentProps { export enum ContentType { category, - app, + app } const Apps = (props: ComponentProps): JSX.Element => { diff --git a/client/src/components/Bookmarks/BookmarkForm/BookmarkForm.tsx b/client/src/components/Bookmarks/BookmarkForm/BookmarkForm.tsx index b023db6..4eb2937 100644 --- a/client/src/components/Bookmarks/BookmarkForm/BookmarkForm.tsx +++ b/client/src/components/Bookmarks/BookmarkForm/BookmarkForm.tsx @@ -37,13 +37,13 @@ const BookmarkForm = (props: ComponentProps): JSX.Element => { const [useCustomIcon, setUseCustomIcon] = useState(false); const [customIcon, setCustomIcon] = useState(null); const [categoryData, setCategoryData] = useState({ - name: "", - type: "bookmarks", + name: '', + type: 'bookmarks', }); const [bookmarkData, setBookmarkData] = useState({ - name: "", - url: "", + name: '', + url: '', categoryId: -1, icon: '', }); @@ -53,7 +53,7 @@ const BookmarkForm = (props: ComponentProps): JSX.Element => { if (props.category) { setCategoryData({ name: props.category.name, type: props.category.type }); } else { - setCategoryData({ name: "", type: "bookmarks" }); + setCategoryData({ name: '', type: 'bookmarks' }); } }, [props.category]); @@ -68,8 +68,8 @@ const BookmarkForm = (props: ComponentProps): JSX.Element => { }); } else { setBookmarkData({ - name: "", - url: "", + name: '', + url: '', categoryId: -1, icon: '', }); diff --git a/client/src/components/Bookmarks/BookmarkTable/BookmarkTable.tsx b/client/src/components/Bookmarks/BookmarkTable/BookmarkTable.tsx index 084f670..0fca8fb 100644 --- a/client/src/components/Bookmarks/BookmarkTable/BookmarkTable.tsx +++ b/client/src/components/Bookmarks/BookmarkTable/BookmarkTable.tsx @@ -232,7 +232,7 @@ const BookmarkTable = (props: ComponentProps): JSX.Element => {
{isCustomOrder ? ( -

You can drag and drop single rows to reorder bookmarklication

+

You can drag and drop single rows to reorder bookmark

) : (

Custom order is disabled. You can change it in{" "} diff --git a/client/src/components/Home/Home.tsx b/client/src/components/Home/Home.tsx index 5f5033a..f1074da 100644 --- a/client/src/components/Home/Home.tsx +++ b/client/src/components/Home/Home.tsx @@ -59,6 +59,13 @@ const Home = (props: ComponentProps): JSX.Element => { } }, [getAppCategories]); + // Load app categories + useEffect(() => { + if (appCategories.length === 0) { + getAppCategories(); + } + }, [getAppCategories]); + // Load apps useEffect(() => { if (apps.length === 0) { diff --git a/client/src/store/reducers/app.ts b/client/src/store/reducers/app.ts index 37eb1c3..9d28cd2 100644 --- a/client/src/store/reducers/app.ts +++ b/client/src/store/reducers/app.ts @@ -245,6 +245,16 @@ const reorderApps = (state: State, action: Action): State => { }; const sortApps = (state: State, action: Action): State => { + // const tmpCategories = [...state.categories]; + + // tmpCategories.forEach((category: Category) => { + // category.apps = sortData(category.apps, action.payload); + // }); + + // return { + // ...state, + // categories: tmpCategories, + // }; const sortedApps = sortData(state.apps, action.payload); return {