Skip to content

Commit

Permalink
show error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindgamesnl committed Dec 7, 2024
1 parent 866a009 commit 541308c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions client/src/client/services/voice/VoiceModule.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export const VoiceModule = new class IVoiceModule {
voiceState: {
loading: false,
failedGeneric: true,
failedErrorContext: message,
enabled: false,
},
});
Expand Down
2 changes: 1 addition & 1 deletion client/src/client/services/voice/peers/PeerManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class PeerManager {
if (this.reconnectionAttempts < this.maxReconnectionAttempts) {
this.reconnect();
} else {
VoiceModule.panic('Connection timeout after multiple attempts');
VoiceModule.panic('Failed after multiple attempts, server rejected connection, slot or integrity error');
}
}

Expand Down
1 change: 1 addition & 0 deletions client/src/state/store.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const initialState = {
voiceState: {
loading: false,
failedGeneric: false,
failedErrorContext: 'No error context provided',
autoJoinVoiceChat: false,
serverHasVoiceChat: false,
peersHidden: false,
Expand Down
7 changes: 5 additions & 2 deletions client/src/views/client/pages/voice/VoicePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ModerationWarning } from '../../../../components/voice/ModerationWarnin
import { msg } from '../../../../client/OpenAudioAppContainer';
import ChannelList from '../../../../components/voice/ui/VoiceChannels';

function VoiceErrorState({ color }) {
function VoiceErrorState({ color, errorMessage }) {
return (
<div className="h-full p-3">
<div className="max-w-2/3 h-full mx-auto">
Expand All @@ -31,6 +31,9 @@ function VoiceErrorState({ color }) {
<p className="text-gray-400">
{msg('vc.state.error.body')}
</p>
<p className="text-gray-400 mt-2">
{ errorMessage }
</p>
</div>

<div className="space-y-4">
Expand Down Expand Up @@ -124,7 +127,7 @@ function ActionCard({
function VoicePage({ voiceState, color }) {

if (voiceState.failedGeneric) {
return <VoiceErrorState color={color} />;
return <VoiceErrorState color={color} errorMessage={voiceState.failedErrorContext} />;
}

if (voiceState.loading) {
Expand Down

0 comments on commit 541308c

Please sign in to comment.