From a4abbf78440227f41f8db7ef8e24bc4e51aa919a Mon Sep 17 00:00:00 2001 From: pavel Date: Wed, 25 Feb 2026 01:08:13 +0100 Subject: [PATCH] f --- desktop/app.js | 11 +++++++---- desktop/styles.css | 1 + static/styles.css | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/desktop/app.js b/desktop/app.js index f40ef0b..88fe929 100644 --- a/desktop/app.js +++ b/desktop/app.js @@ -1214,7 +1214,8 @@ function renderSounds(sounds) { async function deleteSound(soundId) { if (!state.selectedGuildId) return; try { - const response = await fetch(`/guilds/${state.selectedGuildId}/sounds/${soundId}`, { + const url = API_BASE_URL ? `${API_BASE_URL}/guilds/${state.selectedGuildId}/sounds/${soundId}` : `/guilds/${state.selectedGuildId}/sounds/${soundId}`; + const response = await fetch(url, { method: 'DELETE' }); if (!response.ok) { @@ -1228,11 +1229,12 @@ async function deleteSound(soundId) { } function playRemoteSound(url) { + const fullUrl = API_BASE_URL && !url.startsWith('http') ? `${API_BASE_URL}${url}` : url; if (state.voice.ws && state.voice.ws.readyState === WebSocket.OPEN) { - state.voice.ws.send(JSON.stringify({ type: 'play_sound', sound_url: url })); + state.voice.ws.send(JSON.stringify({ type: 'play_sound', sound_url: fullUrl })); } // Also play locally immediately - const audio = new Audio(url); + const audio = new Audio(fullUrl); audio.play().catch(console.error); } @@ -1459,7 +1461,8 @@ async function init() { try { // Need to use fetch directly because api() might not handle FormData correctly depending on implementation - const response = await fetch(`/guilds/${state.selectedGuildId}/sounds`, { + const url = API_BASE_URL ? `${API_BASE_URL}/guilds/${state.selectedGuildId}/sounds` : `/guilds/${state.selectedGuildId}/sounds`; + const response = await fetch(url, { method: 'POST', body: formData }); diff --git a/desktop/styles.css b/desktop/styles.css index afa8f48..034d083 100644 --- a/desktop/styles.css +++ b/desktop/styles.css @@ -367,6 +367,7 @@ select { pointer-events: none; white-space: nowrap; order: -1; + margin-right: 4px; } @keyframes fadeInOut { diff --git a/static/styles.css b/static/styles.css index afa8f48..034d083 100644 --- a/static/styles.css +++ b/static/styles.css @@ -367,6 +367,7 @@ select { pointer-events: none; white-space: nowrap; order: -1; + margin-right: 4px; } @keyframes fadeInOut {