Strictify audio-messages (#10410)
This commit is contained in:
parent
d4b81882e5
commit
c238e72e47
4 changed files with 9 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2021 - 2022 The Matrix.org Foundation C.I.C.
|
Copyright 2021 - 2023 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -26,7 +26,7 @@ import AudioPlayerBase from "./AudioPlayerBase";
|
||||||
import { PlaybackState } from "../../../audio/Playback";
|
import { PlaybackState } from "../../../audio/Playback";
|
||||||
|
|
||||||
export default class AudioPlayer extends AudioPlayerBase {
|
export default class AudioPlayer extends AudioPlayerBase {
|
||||||
protected renderFileSize(): string {
|
protected renderFileSize(): string | null {
|
||||||
const bytes = this.props.playback.sizeBytes;
|
const bytes = this.props.playback.sizeBytes;
|
||||||
if (!bytes) return null;
|
if (!bytes) return null;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
Copyright 2021 - 2023 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -46,7 +46,8 @@ export default class Clock extends React.Component<Props> {
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
return (
|
return (
|
||||||
<span aria-live={this.props["aria-live"]} role={this.props.role} className="mx_Clock">
|
<span aria-live={this.props["aria-live"]} role={this.props.role} className="mx_Clock">
|
||||||
{this.props.formatFn(this.props.seconds)}
|
{/* formatFn set by defaultProps */}
|
||||||
|
{this.props.formatFn!(this.props.seconds)}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2022 The Matrix.org Foundation C.I.C.
|
Copyright 2022 - 2023 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -45,7 +45,7 @@ export const DevicesContextMenu: React.FC<Props> = ({ containerRef, currentDevic
|
||||||
<IconizedContextMenu
|
<IconizedContextMenu
|
||||||
mountAsChild={false}
|
mountAsChild={false}
|
||||||
onFinished={() => {}}
|
onFinished={() => {}}
|
||||||
{...toLeftOrRightOf(containerRef.current.getBoundingClientRect(), 0)}
|
{...(containerRef.current ? toLeftOrRightOf(containerRef.current.getBoundingClientRect(), 0) : {})}
|
||||||
>
|
>
|
||||||
<IconizedContextMenuOptionList>{deviceOptions}</IconizedContextMenuOptionList>
|
<IconizedContextMenuOptionList>{deviceOptions}</IconizedContextMenuOptionList>
|
||||||
</IconizedContextMenu>
|
</IconizedContextMenu>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright 2021 The Matrix.org Foundation C.I.C.
|
Copyright 2021 - 2023 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -69,7 +69,7 @@ export default class PlaybackClock extends React.PureComponent<IProps, IState> {
|
||||||
let seconds = this.state.seconds;
|
let seconds = this.state.seconds;
|
||||||
if (this.state.playbackPhase === PlaybackState.Stopped) {
|
if (this.state.playbackPhase === PlaybackState.Stopped) {
|
||||||
if (Number.isFinite(this.props.defaultDisplaySeconds)) {
|
if (Number.isFinite(this.props.defaultDisplaySeconds)) {
|
||||||
seconds = this.props.defaultDisplaySeconds;
|
seconds = this.props.defaultDisplaySeconds ?? this.props.playback.durationSeconds;
|
||||||
} else {
|
} else {
|
||||||
seconds = this.state.durationSeconds;
|
seconds = this.state.durationSeconds;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue