[#700] fixed searchbar blink (#701)

This commit is contained in:
Camille Moussu
2026-03-25 07:09:21 +01:00
committed by GitHub
parent 5f26bef4dc
commit fdc9d7651b
2 changed files with 12 additions and 4 deletions
+7
View File
@@ -0,0 +1,7 @@
import { RootState } from "@/app/store";
import { createSelector } from "@reduxjs/toolkit";
export const selectCalendars = createSelector(
(state: RootState) => state.calendars.list,
(list) => Object.values(list)
);
+5 -4
View File
@@ -1,4 +1,5 @@
import { useAppDispatch, useAppSelector } from "@/app/hooks";
import { selectCalendars } from "@/app/selectors/selectCalendars";
import { searchEventsAsync } from "@/features/Search/SearchSlice";
import { setView } from "@/features/Settings/SettingsSlice";
import { userAttendee } from "@/features/User/models/attendee";
@@ -31,12 +32,12 @@ import UserSearch from "../Attendees/AttendeeSearch";
import { PeopleSearch, User } from "../Attendees/PeopleSearch";
import { CalendarItemList } from "../Calendar/CalendarItemList";
const SEARCH_OBJECT_TYPES = ["user", "contact"];
export default function SearchBar() {
const { t } = useI18n();
const dispatch = useAppDispatch();
const calendars = Object.values(
useAppSelector((state) => state.calendars.list)
);
const calendars = useAppSelector(selectCalendars);
const userId = useAppSelector((state) => state.user.userData?.openpaasId);
const personnalCalendars = userId
? calendars.filter((c) => extractEventBaseUuid(c.id) === userId)
@@ -227,7 +228,7 @@ export default function SearchBar() {
onChange={(_event, users) => {
handleContactSelect(users);
}}
objectTypes={["user", "contact"]}
objectTypes={SEARCH_OBJECT_TYPES}
onToggleEventPreview={() => {}}
customSlotProps={{
popper: {