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

Bugfix/remove get widget data datatype #2888

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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