diff --git a/native/calendar/entry.react.js b/native/calendar/entry.react.js --- a/native/calendar/entry.react.js +++ b/native/calendar/entry.react.js @@ -26,6 +26,7 @@ useDeleteEntry, useSaveEntry, } from 'lib/actions/entry-actions.js'; +import { extractKeyserverIDFromID } from 'lib/keyserver-conn/keyserver-call-utils.js'; import { registerFetchKey } from 'lib/reducers/loading-reducer.js'; import { connectionSelector } from 'lib/selectors/keyserver-selectors.js'; import { colorIsDark } from 'lib/shared/color-utils.js'; @@ -60,7 +61,6 @@ import type { EntryInfoWithHeight } from './calendar.react.js'; import LoadingIndicator from './loading-indicator.react.js'; -import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; import { type MessageListParams, useNavigateToThread, @@ -783,11 +783,6 @@ navContext, }), ); - const connection = useSelector( - connectionSelector(authoritativeKeyserverID), - ); - invariant(connection, 'keyserver missing from keyserverStore'); - const online = connection.status === 'connected'; const styles = useStyles(unboundStyles); const navigateToThread = useNavigateToThread(); @@ -801,6 +796,14 @@ const { threadInfo: unresolvedThreadInfo, ...restProps } = props; const threadInfo = useResolvedThreadInfo(unresolvedThreadInfo); + const keyserverID = extractKeyserverIDFromID(threadInfo.id); + const connection = useSelector(connectionSelector(keyserverID)); + invariant( + connection, + `keyserver ${keyserverID} missing from keyserverStore`, + ); + const online = connection.status === 'connected'; + return (