Skip to content

Commit

Permalink
Bugfix/remove get widget data datatype (#2888)
Browse files Browse the repository at this point in the history
* Use dataType=json for ChromeOS player consumer
* Remove unnecessary console log
  • Loading branch information
rubenberttpingol authored Jan 30, 2025
1 parent a58c5bb commit ea9459d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions modules/src/xibo-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,20 @@ const XiboPlayer = function() {
// or if we are not in preview and have empty data on Widget (like text)
// do not run ajax use that data instead
if (String(currentWidget.url) !== 'null') {
let ajaxOptions = {
method: 'GET',
url: currentWidget.url,
};

// We include dataType for ChromeOS player consumer
if (window.location && window.location.pathname === '/pwa/') {
ajaxOptions.dataType = 'json';
}

// else get data from widget.url,
// this will be either getData for preview
// or new json file for v4 players
$.ajax({
method: 'GET',
url: currentWidget.url,
dataType: 'json',
}).done(function(data) {
$.ajax(ajaxOptions).done(function(data) {
// The contents of the JSON file will be an object with data and meta
// add in local data.
if (localData) {
Expand Down

0 comments on commit ea9459d

Please sign in to comment.