Hide unpinnable pinned messages in more cases (#7921)
* Hide unpinnable pinned messages in more cases Signed-off-by: Robin Townsend <robin@robin.town> * Fix typo Signed-off-by: Robin Townsend <robin@robin.town> * Test that unpinnable pinned messages get hidden Signed-off-by: Robin Townsend <robin@robin.town> * Fix cli.relations error in test Signed-off-by: Robin Townsend <robin@robin.town> * Use event: true shortcut when calling mkEvent Signed-off-by: Robin Townsend <robin@robin.town> * Use mockResolvedValue instead of mockReturnValue for async mock Signed-off-by: Robin Townsend <robin@robin.town> * Actually mock redacted messages correctly Signed-off-by: Robin Townsend <robin@robin.town> * Ensure that panel is updated before assertions are made Signed-off-by: Robin Townsend <robin@robin.town> * Move calls to update out of act They don't need to be there. Signed-off-by: Robin Townsend <robin@robin.town>
This commit is contained in:
parent
d883309dcd
commit
f9ad2a5151
3 changed files with 102 additions and 1 deletions
|
@ -99,7 +99,7 @@ const PinnedMessagesCard = ({ room, onClose }: IProps) => {
|
|||
const promises = pinnedEventIds.map(async eventId => {
|
||||
const timelineSet = room.getUnfilteredTimelineSet();
|
||||
const localEvent = timelineSet?.getTimelineForEvent(eventId)?.getEvents().find(e => e.getId() === eventId);
|
||||
if (localEvent) return localEvent;
|
||||
if (localEvent) return PinningUtils.isPinnable(localEvent) ? localEvent : null;
|
||||
|
||||
try {
|
||||
// Fetch the event and latest edit in parallel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue