ui: reload hls on site change

This commit is contained in:
nick-delirium 2025-02-12 10:50:26 +01:00
parent 2654273f97
commit 3be8e8092d
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -14,7 +14,7 @@ import HighlightsListHeader from './HighlightsListHeader';
import withPermissions from 'HOCs/withPermissions';
function HighlightsList() {
const { notesStore } = useStore();
const { notesStore, projectsStore } = useStore();
const [activeId, setActiveId] = React.useState<string | null>(null);
const [editModalOpen, setEditModalOpen] = React.useState(false);
const [editHl, setEditHl] = React.useState<Record<string, any>>({
@ -22,6 +22,7 @@ function HighlightsList() {
isPublic: false
});
const activeProject = projectsStore.activeSiteId;
const query = notesStore.query;
const limit = notesStore.pageSize;
const listLength = notesStore.notes.length;
@ -33,7 +34,7 @@ function HighlightsList() {
isPending,
refetch
} = useQuery({
queryKey: ['notes', page, query, activeTags],
queryKey: ['notes', page, query, activeTags, activeProject],
queryFn: () => notesStore.fetchNotes(),
retry: 3
});