Skip to content

Commit

Permalink
Fix: Selecting multiple videos while embedding a Video Experience res…
Browse files Browse the repository at this point in the history
…ults in error (#398)
  • Loading branch information
burhandodhy authored Jul 30, 2024
1 parent 828cd68 commit 7458147
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions assets/js/src/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,21 @@
}, [pictureinpicture]);

// Sanitize the IDs we need
var sanitizeIds = function (id) {
if (id?.indexOf('ref:') === 0) {
return id;
var sanitizeIds = function (ids) {
if (!ids) {
return ids;
}
return id?.replace(/\D/g, '');

return ids
.split(',')
.map(function (id) {
id = id.trim();
if (id.indexOf('ref:') === 0) {
return id;
}
return id.replace(/\D/g, '');
})
.join(',');
};

/**
Expand Down

0 comments on commit 7458147

Please sign in to comment.