refactor: clean up code formatting and improve consistency across multiple components
Deploy to VPS / deploy (push) Failing after 1m59s

This commit is contained in:
asepharyana
2026-07-26 15:39:41 +07:00
parent c2502a0e5f
commit 300512b2cb
12 changed files with 47 additions and 108 deletions
@@ -31,9 +31,7 @@ export default function VoicePage() {
const [voiceStatus, setVoiceStatus] = useState<VoiceStatus | null>(null);
const [speakers, setSpeakers] = useState<ActiveSpeaker[]>([]);
const [guilds, setGuilds] = useState<
Array<{ id: string; name: string }>
>([]);
const [guilds, setGuilds] = useState<Array<{ id: string; name: string }>>([]);
const [voiceChannels, setVoiceChannels] = useState<
Array<{ id: string; name: string }>
>([]);
@@ -74,9 +72,7 @@ export default function VoicePage() {
const unsubSpeaker = ws.on("voice_active_user", (user) => {
const speaker = user as ActiveSpeaker;
setSpeakers((prev) => {
const existing = prev.findIndex(
(s) => s.userId === speaker.userId,
);
const existing = prev.findIndex((s) => s.userId === speaker.userId);
if (existing >= 0) {
const next = [...prev];
next[existing] = speaker;
@@ -224,9 +220,7 @@ export default function VoicePage() {
) : (
<Button
onClick={handleConnect}
disabled={
voiceLoading || !selectedGuild || !selectedChannel
}
disabled={voiceLoading || !selectedGuild || !selectedChannel}
>
{voiceLoading ? (
<Loader2 className="size-4 animate-spin mr-1.5" />
@@ -286,9 +280,7 @@ export default function VoicePage() {
setMicActive(checked);
try {
await voiceApi.sendCommand(
checked
? "voice:transmit:start"
: "voice:transmit:stop",
checked ? "voice:transmit:start" : "voice:transmit:stop",
);
} catch {
setMicActive(!checked);