fix aria and scope file workaround to mobile

This commit is contained in:
7w1 committed 2026-07-21 21:50:16 -05:00
1 parent 3e955ef3f8
commit fa73450e10
1 file changed
+13 -7
+13 -7
View File
@@ -400,12 +400,18 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
setUploadBoard(true);
const safeFiles = files.map(safeFile);
// Eager-read to avoid Android content URI expiry after SAF picker
const blobbedFiles = await Promise.all(
safeFiles.map(async (f) => {
const buf = await f.arrayBuffer();
return new File([buf], f.name, { type: f.type, lastModified: f.lastModified });
})
);
const blobbedFiles = mobileOrTablet()
? await Promise.all(
safeFiles.map(async (f) => {
try {
const buf = await f.arrayBuffer();
return new File([buf], f.name, { type: f.type, lastModified: f.lastModified });
} catch {
return f;
}
})
)
: safeFiles;
const makeMetadata = () => ({
markedAsSpoiler: false,
waveform: audioMeta?.waveform,
@@ -1903,7 +1909,7 @@ export const RoomInput = forwardRef<HTMLDivElement, RoomInputProps>(
: 'Record audio message'
}
style={{ backgroundColor: 'transparent' }}
aria-pressed={showAudioRecorder}
aria-pressed={!hasContent ? showAudioRecorder : undefined}
onClick={() => {
if (showAudioRecorder) {
audioRecorderRef.current?.stop();