fix colors and threads
This commit is contained in:
4 files changed
+20
-3
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Fix opacity rendering in name colors.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Fix threads rendering fallback replies.
|
||||
@@ -482,7 +482,12 @@ export function ThreadDrawer({ room, threadRootId, onClose, overlay }: ThreadDra
|
||||
const thread = room.getThread(threadRootId);
|
||||
const fromThread = thread?.events ?? [];
|
||||
if (fromThread.length > 0) {
|
||||
return fromThread.filter((ev) => ev.getId() !== threadRootId && !reactionOrEditEvent(ev));
|
||||
return fromThread.filter(
|
||||
(ev) =>
|
||||
ev.getId() !== threadRootId &&
|
||||
!reactionOrEditEvent(ev) &&
|
||||
ev.getContent()?.['m.relates_to']?.is_falling_back !== true
|
||||
);
|
||||
}
|
||||
return room
|
||||
.getUnfilteredTimelineSet()
|
||||
@@ -492,7 +497,8 @@ export function ThreadDrawer({ room, threadRootId, onClose, overlay }: ThreadDra
|
||||
(ev) =>
|
||||
ev.threadRootId === threadRootId &&
|
||||
ev.getId() !== threadRootId &&
|
||||
!reactionOrEditEvent(ev)
|
||||
!reactionOrEditEvent(ev) &&
|
||||
ev.getContent()?.['m.relates_to']?.is_falling_back !== true
|
||||
);
|
||||
})();
|
||||
|
||||
|
||||
@@ -69,7 +69,8 @@ const isValidHex = (c: any): string | undefined => {
|
||||
if (typeof c !== 'string') return undefined;
|
||||
// silly tuwunel smh
|
||||
const cleaned = c.replaceAll(/["']/g, '').trim();
|
||||
return /^#([0-9A-F]{3,6})$/i.test(cleaned) ? cleaned : undefined;
|
||||
// Strictly allow only 3 or 6 digit hex codes, aka no opacity
|
||||
return /^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(cleaned) ? cleaned : undefined;
|
||||
};
|
||||
const sanitizeFont = (f: string) => f.replaceAll(/[;{}<>]/g, '').slice(0, 32);
|
||||
|
||||
|
||||
Reference in new issue
Block a user