Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.

Commit

Permalink
fixed bug with player not updating properly
Browse files Browse the repository at this point in the history
  • Loading branch information
BrainFooLong committed Sep 10, 2017
1 parent 087ba86 commit a9d98ee
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ $(function () {
'parameter': parameter
}, function (data) {
data = JSON.parse(data)
if (data) {
lastStatusData = data.status
parseStatus(data.status)
statusTo = setTimeout(function () {
dbusCmd('status')
}, 1000)
}
lastStatusData = data.status
parseStatus(data.status)
if (callback) callback(data)
statusTo = setTimeout(function () {
dbusCmd('status')
}, 1000)
})
}

Expand All @@ -35,7 +33,7 @@ $(function () {
}

var parseStatus = function (statusData) {
if (statusData === 0 || statusData.status === 'stopped') {
if (!statusData || statusData === 0 || statusData.status === 'stopped') {
source.html(t('stopped'))
controls.hide()
} else {
Expand Down

0 comments on commit a9d98ee

Please sign in to comment.