1
0
Fork 0
forked from Mirrors/gomuks

web/preferences: add option to not render read receipts

This commit is contained in:
Tulir Asokan 2024-12-18 21:21:05 +02:00
parent 9cbc20bb07
commit ac9e6f356d
3 changed files with 13 additions and 1 deletions

View file

@ -47,6 +47,12 @@ export const preferences = {
allowedContexts: anyContext, allowedContexts: anyContext,
defaultValue: true, defaultValue: true,
}), }),
display_read_receipts: new Preference<boolean>({
displayName: "Display read receipts",
description: "Should read receipts be rendered in the timeline?",
allowedContexts: anyContext,
defaultValue: true,
}),
show_media_previews: new Preference<boolean>({ show_media_previews: new Preference<boolean>({
displayName: "Show image and video previews", displayName: "Show image and video previews",
description: "If disabled, images and videos will only be visible after clicking and will not be downloaded automatically.", description: "If disabled, images and videos will only be visible after clicking and will not be downloaded automatically.",

View file

@ -102,6 +102,11 @@ const StylePreferences = ({ client, activeRoom }: StylePreferencesProps) => {
display: none; display: none;
} }
`, [preferences.show_date_separators]) `, [preferences.show_date_separators])
useStyle(() => !preferences.display_read_receipts && css`
:root {
--timeline-status-size: 2rem;
}
`, [preferences.display_read_receipts])
useAsyncStyle(() => preferences.code_block_theme === "auto" ? ` useAsyncStyle(() => preferences.code_block_theme === "auto" ? `
@import url("_gomuks/codeblock/github.css") (prefers-color-scheme: light); @import url("_gomuks/codeblock/github.css") (prefers-color-scheme: light);
@import url("_gomuks/codeblock/github-dark.css") (prefers-color-scheme: dark); @import url("_gomuks/codeblock/github-dark.css") (prefers-color-scheme: dark);

View file

@ -199,7 +199,8 @@ const TimelineEvent = ({ evt, prevEvt, disableMenu }: TimelineEventProps) => {
</ContentErrorBoundary> </ContentErrorBoundary>
{evt.reactions ? <EventReactions reactions={evt.reactions}/> : null} {evt.reactions ? <EventReactions reactions={evt.reactions}/> : null}
</div> </div>
{!evt.event_id.startsWith("~") && <ReadReceipts room={roomCtx.store} eventID={evt.event_id} />} {!evt.event_id.startsWith("~") && roomCtx.store.preferences.display_read_receipts &&
<ReadReceipts room={roomCtx.store} eventID={evt.event_id} />}
{evt.sender === client.userID && evt.transaction_id ? <EventSendStatus evt={evt}/> : null} {evt.sender === client.userID && evt.transaction_id ? <EventSendStatus evt={evt}/> : null}
</div> </div>
return <> return <>