) {
if (body === '') return ;
if (customBody) {
if (customBody === '') return ;
diff --git a/src/app/components/message/Reply.tsx b/src/app/components/message/Reply.tsx
index eddc13e27..2afd2aae3 100644
--- a/src/app/components/message/Reply.tsx
+++ b/src/app/components/message/Reply.tsx
@@ -68,10 +68,10 @@ export const ThreadIndicator = as<'div'>(({ ...props }, ref) => (
type ReplyProps = {
room: Room;
- timelineSet?: EventTimelineSet | undefined;
+ timelineSet?: EventTimelineSet;
replyEventId: string;
- threadRootId?: string | undefined;
- onClick?: MouseEventHandler | undefined;
+ threadRootId?: string;
+ onClick?: MouseEventHandler;
};
export const Reply = as<'div', ReplyProps>(
@@ -119,10 +119,10 @@ export const Reply = as<'div', ReplyProps>(
if (format === 'org.matrix.custom.html' && formattedBody) {
const strippedHtml = trimReplyFromFormattedBody(formattedBody)
- .replace(/
/gi, ' ')
- .replace(/<\/p>\s*]*>/gi, ' ')
- .replace(/<\/?p[^>]*>/gi, '')
- .replace(/(?:\r\n|\r|\n)/g, ' ');
+ .replaceAll(/
/gi, ' ')
+ .replaceAll(/<\/p>\s*
]*>/gi, ' ')
+ .replaceAll(/<\/?p[^>]*>/gi, '')
+ .replaceAll(/(?:\r\n|\r|\n)/g, ' ');
const parserOpts = getReactCustomHtmlParser(mx, room.roomId, {
linkifyOpts: LINKIFY_OPTS,
useAuthentication,
@@ -130,7 +130,7 @@ export const Reply = as<'div', ReplyProps>(
});
bodyJSX = parse(strippedHtml, parserOpts) as JSX.Element;
} else if (body) {
- const strippedBody = trimReplyFromBody(body).replace(/(?:\r\n|\r|\n)/g, ' ');
+ const strippedBody = trimReplyFromBody(body).replaceAll(/(?:\r\n|\r|\n)/g, ' ');
bodyJSX = scaleSystemEmoji(strippedBody);
}
diff --git a/src/app/components/message/content/AudioContent.tsx b/src/app/components/message/content/AudioContent.tsx
index 6ef9349ba..26d74db88 100644
--- a/src/app/components/message/content/AudioContent.tsx
+++ b/src/app/components/message/content/AudioContent.tsx
@@ -1,5 +1,5 @@
/* eslint-disable jsx-a11y/media-has-caption */
-import { ReactNode, useCallback, useRef, useState } from 'react';
+import { ReactNode, useCallback, useEffect, useRef, useState } from 'react';
import { Badge, Chip, Icon, IconButton, Icons, ProgressBar, Spinner, Text, toRem } from 'folds';
import { EncryptedAttachmentInfo } from 'browser-encrypt-attachment';
import { Range } from 'react-range';
@@ -18,6 +18,7 @@ import { useThrottle } from '$hooks/useThrottle';
import { secondsToMinutesAndSeconds } from '$utils/common';
import { decryptFile, downloadEncryptedMedia, downloadMedia, mxcUrlToHttp } from '$utils/matrix';
import { useMediaAuthentication } from '$hooks/useMediaAuthentication';
+import { MEDIA_VOLUME_KEY } from '$components/media';
const PLAY_TIME_THROTTLE_OPS = {
wait: 500,
@@ -60,6 +61,14 @@ export function AudioContent({
const audioRef = useRef(null);
+ useEffect(() => {
+ const stored = localStorage.getItem(MEDIA_VOLUME_KEY);
+ if (audioRef.current && stored !== null) {
+ const parsed = parseFloat(stored);
+ if (!Number.isNaN(parsed)) audioRef.current.volume = parsed;
+ }
+ }, []);
+
const [currentTime, setCurrentTime] = useState(0);
// duration in seconds. (NOTE: info.duration is in milliseconds)
const infoDuration = info.duration ?? 0;
@@ -197,7 +206,14 @@ export function AudioContent({
>
),
children: (
-