Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f7a8f64e2 |
@@ -43,7 +43,9 @@ export function SettingTile({ title, description, before, after, children }: Set
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
{description && (
|
{description && (
|
||||||
<Text className={BreakWord} size="T200" priority="300">
|
// [Gitea #291] A <div>, not a <p>: many tiles pass blocks (badges,
|
||||||
|
// <Box>, <Text>) as the description, which is invalid inside a <p>.
|
||||||
|
<Text as="div" className={BreakWord} size="T200" priority="300">
|
||||||
{description}
|
{description}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -310,9 +310,13 @@ export function UploadCardRenderer({
|
|||||||
const { file } = upload;
|
const { file } = upload;
|
||||||
const fileSizeExceeded = file.size >= allowSize;
|
const fileSizeExceeded = file.size >= allowSize;
|
||||||
|
|
||||||
if (upload.status === UploadStatus.Idle && !fileSizeExceeded) {
|
// [Gitea #291] Start in an effect, not during render: the desktop taskbar
|
||||||
startUpload();
|
// progress hook subscribes to the upload atoms, so a render-time start
|
||||||
}
|
// updated another component mid-render (React warning on every image send).
|
||||||
|
const idle = upload.status === UploadStatus.Idle;
|
||||||
|
useEffect(() => {
|
||||||
|
if (idle && !fileSizeExceeded) startUpload();
|
||||||
|
}, [idle, fileSizeExceeded, startUpload]);
|
||||||
|
|
||||||
const handleSpoiler = (marked: boolean) => {
|
const handleSpoiler = (marked: boolean) => {
|
||||||
setMetadata(fileItem, { ...metadata, markedAsSpoiler: marked });
|
setMetadata(fileItem, { ...metadata, markedAsSpoiler: marked });
|
||||||
|
|||||||
@@ -50,14 +50,6 @@ type FlatClip = {
|
|||||||
* A management toggle reveals the pack editors (personal + this room, if
|
* A management toggle reveals the pack editors (personal + this room, if
|
||||||
* permitted). Space-wide packs are managed from Space settings.
|
* permitted). Space-wide packs are managed from Space settings.
|
||||||
*/
|
*/
|
||||||
/** [EC#13, EC#47] Why the fork refused to play a clip, for the user. */
|
|
||||||
export const soundboardRefusalText = (reason: string | undefined): string => {
|
|
||||||
if (reason === 'muted') return 'Unmute your microphone to play a soundboard clip.';
|
|
||||||
if (reason === 'not_permitted')
|
|
||||||
return "The soundboard isn't available in this voice channel (only microphone audio is allowed here).";
|
|
||||||
return 'Could not play that clip.';
|
|
||||||
};
|
|
||||||
|
|
||||||
export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
|
export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
|
||||||
const mx = useMatrixClient();
|
const mx = useMatrixClient();
|
||||||
const { room } = callEmbed;
|
const { room } = callEmbed;
|
||||||
@@ -130,10 +122,13 @@ export function CallSoundboard({ callEmbed }: CallSoundboardProps) {
|
|||||||
.catch(() => undefined);
|
.catch(() => undefined);
|
||||||
const result = await callEmbed.control.injectAudio(url, vol, clipBytes);
|
const result = await callEmbed.control.injectAudio(url, vol, clipBytes);
|
||||||
if (!result.played) {
|
if (!result.played) {
|
||||||
// [EC#13, EC#47] Refused fork-side (mic muted, or the room's token
|
// [EC#13] Refused fork-side (only reason today: local mic muted) —
|
||||||
// only allows the microphone source, as in audio-only rooms) —
|
|
||||||
// don't play it locally either, or the user would think it went out.
|
// don't play it locally either, or the user would think it went out.
|
||||||
setError(soundboardRefusalText(result.reason));
|
setError(
|
||||||
|
result.reason === 'muted'
|
||||||
|
? 'Unmute your microphone to play a soundboard clip.'
|
||||||
|
: 'Could not play that clip.',
|
||||||
|
);
|
||||||
done();
|
done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user