import { useAppSelector } from './useAppSelector' ; /**
 * 返回某些会话是否有未读信息
 */ export function useUnread ( converseIds ) { const ack = useAppSelector ( ( state ) => state . chat . ack ) ; const lastMessageMap = useAppSelector ( ( state ) => state . chat . lastMessageMap ) ; return converseIds . map ( ( converseId ) => { if ( ack [ converseId ] === undefined && lastMessageMap [ converseId ] !== undefined ) { return true ; } return lastMessageMap [ converseId ] > ack [ converseId ] ; } ) ; }