For distribution lists make sure we only use convos with uuid

This commit is contained in:
Josh Perez 2022-08-09 19:45:39 -04:00 committed by GitHub
parent faf6c41332
commit 0fc5976117
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,6 +67,17 @@ enum Page {
HideStoryFrom = 'HideStoryFrom', HideStoryFrom = 'HideStoryFrom',
} }
function filterConversations(
conversations: ReadonlyArray<ConversationType>,
searchTerm: string
) {
return filterAndSortConversationsByRecent(
conversations,
searchTerm,
undefined
).filter(conversation => conversation.uuid);
}
export const StoriesSettingsModal = ({ export const StoriesSettingsModal = ({
candidateConversations, candidateConversations,
distributionLists, distributionLists,
@ -99,11 +110,7 @@ export const StoriesSettingsModal = ({
const [searchTerm, setSearchTerm] = useState(''); const [searchTerm, setSearchTerm] = useState('');
const [filteredConversations, setFilteredConversations] = useState( const [filteredConversations, setFilteredConversations] = useState(
filterAndSortConversationsByRecent( filterConversations(candidateConversations, searchTerm)
candidateConversations,
searchTerm,
undefined
)
); );
const [selectedContacts, setSelectedContacts] = useState< const [selectedContacts, setSelectedContacts] = useState<
@ -145,11 +152,7 @@ export const StoriesSettingsModal = ({
useEffect(() => { useEffect(() => {
const timeout = setTimeout(() => { const timeout = setTimeout(() => {
setFilteredConversations( setFilteredConversations(
filterAndSortConversationsByRecent( filterConversations(candidateConversations, normalizedSearchTerm)
candidateConversations,
normalizedSearchTerm,
undefined
)
); );
}, 200); }, 200);
return () => { return () => {