Skip to content

Commit

Permalink
its so much faster
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Aug 2, 2024
1 parent 476ed5c commit 1ef8ebc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 32 deletions.
2 changes: 1 addition & 1 deletion client/public/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"buildMajor":1,"buildMinor":125,"buildRevision":263,"buildTag":"dev","buildDate":"Fri Aug 02 2024","build":"1.125.263 dev"}
{"buildMajor":1,"buildMinor":125,"buildRevision":264,"buildTag":"dev","buildDate":"Fri Aug 02 2024","build":"1.125.264 dev"}
25 changes: 3 additions & 22 deletions client/src/components/voice/VoicePeerBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { msg } from '../../client/OpenAudioAppContainer';
const VoicePeerRowMemo = React.memo(VoicePeerRow);

function VoicePeerBox(props) {
const shouldBeHidden = props.voiceState.peersHidden && !props.voiceState.isModerating;
const shouldBeHidden = props.peersHidden && !props.isModerating;
let total = 0;
let talking = 0;

Expand All @@ -31,25 +31,6 @@ function VoicePeerBox(props) {
);
});

// add 25 test peers for testing
for (let i = 0; i < 50; i++) {
const randomBool = Math.random() >= 0.5;
total++;
peers.push(
<VoicePeerRowMemo
loading={randomBool}
name={`Test Peer ${i}`}
displayUuid={`test-peer-${i}`}
key={`test-peer-${i}`}
streamKey={`test-peer-${i}`}
uuid={`test-peer-${i}`}
speaking={i % 2 === 0}
muted={randomBool}
spatialAudio
/>,
);
}

let peerMessage = msg('vc.peerTable');
peerMessage = peerMessage.replace('{talking}', talking);
peerMessage = peerMessage.replace('{total}', total);
Expand Down Expand Up @@ -136,8 +117,8 @@ export default connect(mapStateToProps)(VoicePeerBox);
function mapStateToProps(state) {
return {
voicePeers: state.voiceState.peers,
voiceState: state.voiceState,
currentUser: state.currentUser,
settings: state.settings,
peersHidden: state.voiceState.peersHidden,
isModerating: state.voiceState.isModerating,
};
}
10 changes: 6 additions & 4 deletions client/src/components/voice/ui/VoiceQuickSettings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class VoiceQuickSettings extends React.Component {

render() {
// are we moderating? then only show that banner
if (this.props.voiceState.isModerating) {
if (this.props.isModerating) {
return (
<div className="content-section pt-5">
<div className="content-wrapper-box audio-content full bg-red-800">
Expand Down Expand Up @@ -82,7 +82,7 @@ class VoiceQuickSettings extends React.Component {
return (
<div className="w-full">
<div
className={`avatar-container ${this.props.voiceState.isSpeaking ? ' speaking' : ''}${this.props.voicechatMuted ? ' muted-self' : ''}`}
className={`avatar-container ${this.props.isSpeaking ? ' speaking' : ''}${this.props.voicechatMuted ? ' muted-self' : ''}`}
>
<img
alt="Speaking indicator"
Expand All @@ -97,7 +97,7 @@ class VoiceQuickSettings extends React.Component {
<VoicePageButton
highlighted={this.props.voicechatMuted}
highlightRed
isDisabled={this.props.voiceState.isMutedServerSide}
isDisabled={this.props.isMutedServerSide}
onClick={this.toggleMicMute}
>
<VoiceMicButtonContent muted={this.props.voicechatMuted} />
Expand Down Expand Up @@ -165,7 +165,9 @@ function mapStateToProps(state) {
voicechatDeafened: state.settings.voicechatDeafened,
voicechatVolume: state.settings.voicechatVolume,
voicePiPEnabled: state.settings.voicePiPEnabled,
voiceState: state.voiceState,
isModerating: state.voiceState.isModerating,
isMutedServerSide: state.voiceState.isMutedServerSide,
isSpeaking: state.voiceState.isSpeaking,
currentUser: state.currentUser,
};
}
2 changes: 1 addition & 1 deletion client/src/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"buildMajor":1,"buildMinor":125,"buildRevision":263,"buildTag":"dev","buildDate":"Fri Aug 02 2024","build":"1.125.263 dev"}
{"buildMajor":1,"buildMinor":125,"buildRevision":264,"buildTag":"dev","buildDate":"Fri Aug 02 2024","build":"1.125.264 dev"}
9 changes: 5 additions & 4 deletions client/src/views/client/ClientView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ function ClientView(props) {
/>
<TabPage
name={getTranslation(null, 'navbar.vc')}
hidden={!props.voiceState.ready}
hidden={!props.voiceReady}
buttonContent={<IconMemos.VoiceChat />}
content={<VoicePageMemo />}
subtext={Object.keys(props.voiceState.peers).length > 0 ? `${Object.keys(props.voiceState.peers).length} ${
Object.keys(props.voiceState.peers).length === 1 ? getTranslation(null, 'vc.person')
subtext={props.voicePeerCount > 0 ? `${props.voicePeerCount} ${
props.voicePeerCount === 1 ? getTranslation(null, 'vc.person')
: getTranslation(null, 'vc.people')
}` : null}
colorWhenHasSubtext
Expand Down Expand Up @@ -99,7 +99,8 @@ function mapStateToProps(state) {
inputModal: state.inputModal,
fixedFooter: state.fixedFooter,
loadingOverlay: state.loadingOverlay,
voiceState: state.voiceState,
voiceReady: state.voiceState.ready,
voicePeerCount: Object.keys(state.voiceState.peers).length,
browserSupportIsLimited: state.browserSupportIsLimited,
navbarDetails: state.navbarDetails,
};
Expand Down

0 comments on commit 1ef8ebc

Please sign in to comment.