Skip to content

Commit

Permalink
fix: bookmark items not sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
Meierschlumpf committed Sep 23, 2024
1 parent 6b0b733 commit 4cd5268
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/widgets/src/bookmarks/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import { clientApi } from "@homarr/api/client";
import type { WidgetComponentProps } from "../definition";

export default function BookmarksWidget({ options, width, height }: WidgetComponentProps<"bookmarks">) {
const [data] = clientApi.app.byIds.useSuspenseQuery(options.items);
const [data] = clientApi.app.byIds.useSuspenseQuery(options.items, {
select(data) {
return data.sort((appA, appB) => options.items.indexOf(appA.id) - options.items.indexOf(appB.id));
},
});

return (
<Stack h="100%" gap="sm" p="sm">
Expand Down

0 comments on commit 4cd5268

Please sign in to comment.