Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hang on backendRequest error #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jbandhauer
Copy link

_player_engine.php blocks indefinately when the state sent by the client matches the current state.
But, in the case where the backendRequest hits an error, the app starts trying to reconnect in a
setTimeout loop while it shows a modal UI. So, we don't want _player_engine to block.

This adds an option to backendRequest to send state or not for the cases we want it to block or not.

_player_engine.php blocks indefinately when the state sent by the client matches the current state.
But, in the case where the backendRequest hits an error, the app starts trying to reconnect in a
setTimeout loop while it shows a modal UI. So, we don't want _player_engine to block.

This adds an option to backendRequest to send state or not for the cases we want it to block or not.
@@ -72,17 +72,18 @@ function sendPLCmd(inputcmd) {
});
}

function backendRequest() {
function backendRequest(send_state) {
url = send_state ? ('_player_engine.php?state=' + GUI.MpdState['state']) : '_player_engine.php'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, been doing too much Ruby lately. This should be var url = ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant