make the ui faster
This commit is contained in:
@@ -61,7 +61,7 @@ function App() {
|
||||
const handlePlay = async () => {
|
||||
try {
|
||||
await fetch(`${API_URL}/playback/play`, { method: 'POST' });
|
||||
setPlaybackState('playing');
|
||||
// State will update via WebSocket broadcast
|
||||
} catch (error) {
|
||||
console.error('Failed to play:', error);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ function App() {
|
||||
const handlePause = async () => {
|
||||
try {
|
||||
await fetch(`${API_URL}/playback/pause`, { method: 'POST' });
|
||||
setPlaybackState('paused');
|
||||
// State will update via WebSocket broadcast
|
||||
} catch (error) {
|
||||
console.error('Failed to pause:', error);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ function App() {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ volume: newVolume })
|
||||
});
|
||||
setVolume(newVolume);
|
||||
// Volume will update via WebSocket broadcast
|
||||
} catch (error) {
|
||||
console.error('Failed to set volume:', error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user