diff --git a/lib/socket/calendar-query-handler.react.js b/lib/socket/calendar-query-handler.react.js --- a/lib/socket/calendar-query-handler.react.js +++ b/lib/socket/calendar-query-handler.react.js @@ -9,6 +9,8 @@ useUpdateCalendarQuery, } from '../actions/entry-actions.js'; import type { UpdateCalendarQueryInput } from '../actions/entry-actions.js'; +import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; +import { filterThreadIDsInFilterList } from '../reducers/calendar-filters-reducer.js'; import { connectionSelector } from '../selectors/keyserver-selectors.js'; import { timeUntilCalendarRangeExpiration } from '../selectors/nav-selectors.js'; import { useIsAppForegrounded } from '../shared/lifecycle-utils.js'; @@ -128,7 +130,8 @@ const ConnectedCalendarQueryHandler: React.ComponentType = React.memo(function ConnectedCalendarQueryHandler(props) { - const connection = useSelector(connectionSelector(props.keyserverID)); + const { currentCalendarQuery, keyserverID } = props; + const connection = useSelector(connectionSelector(keyserverID)); invariant(connection, 'keyserver missing from keyserverStore'); const lastUserInteractionCalendar = useSelector( state => state.entryStore.lastUserInteractionCalendar, @@ -139,6 +142,18 @@ const dispatchActionPromise = useDispatchActionPromise(); const calendarQuery = useSelector(state => state.actualizedCalendarQuery); + const getCurrentCalendarQuery = React.useCallback(() => { + const query = currentCalendarQuery(); + return { + ...query, + filters: filterThreadIDsInFilterList( + query.filters, + (threadID: string) => + extractKeyserverIDFromID(threadID) === keyserverID, + ), + }; + }, [currentCalendarQuery, keyserverID]); + return ( ); });