Commit ef7a40dc authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

Directly increment/decrement listener counts in the web app

Otherwise there will be a 5s delay until the table is refreshed before
our own listener is counted in the numbers.
parent a060310e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -115,6 +115,10 @@ function playRoom(id) {

    const play_button = play_row.cells[4].firstChild;
    play_button.textContent = 'Pause';

    const listener_count = play_row.cells[3].firstChild;
    current_listener_count = parseInt(listener_count.textContent);
    listener_count.textContent = current_listener_count + 1;
}

function pauseRoom() {
@@ -140,6 +144,12 @@ function pauseRoom() {
    const play_button = play_row.cells[4].firstChild;
    play_button.textContent = 'Play';

    const listener_count = play_row.cells[3].firstChild;
    current_listener_count = parseInt(listener_count.textContent);
    if (current_listener_count > 0) {
        listener_count.textContent = current_listener_count - 1;
    }

    playing_room = null;
}