Discover URI needs re-encoding

This commit is contained in:
James Barnsley
2021-04-23 06:37:03 +12:00
parent faf5f53692
commit 6615239f8c
5 changed files with 11 additions and 12 deletions

View File

@ -188442,6 +188442,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _util_arrays__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../util/arrays */ "./src/js/util/arrays.js");
/* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../locale */ "./src/js/locale/index.js");
/* harmony import */ var _components_Button__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../components/Button */ "./src/js/components/Button.js");
/* harmony import */ var _util_format__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../util/format */ "./src/js/util/format.js");
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
@ -188492,6 +188493,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
var Discover = /*#__PURE__*/function (_React$Component) {
@ -188530,11 +188532,10 @@ var Discover = /*#__PURE__*/function (_React$Component) {
_defineProperty(_assertThisInitialized(_this), "handleURLSeeds", function () {
var _this$props2 = _this.props,
loadUris = _this$props2.coreActions.loadUris,
seedsProp = _this$props2.match.params.seeds; // Rejoin if we've had to uri-encode these as strings
// We'd need to do this if our URL has been encoded so the whole URL can become
// it's own URI (eg iris:discover:spotify_artist_1234) where we can't use ":"
var seeds = seedsProp.split('_').join(':').split(',');
seedsProp = _this$props2.match.params.seeds;
var seeds = seedsProp.split(',').map(function (uri) {
return Object(_util_format__WEBPACK_IMPORTED_MODULE_23__["decodeUri"])(uri);
});
loadUris(seeds);
_this.setState({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -115,7 +115,7 @@
// Release details
// These are automatically injected to built HTML
var build = "1619082454";
var build = "1619116567";
var version = "3.57.6";
// Construct the script tag

View File

@ -26,6 +26,7 @@ import {
import { arrayOf, indexToArray } from '../../util/arrays';
import { i18n, I18n } from '../../locale';
import Button from '../../components/Button';
import { decodeUri } from '../../util/format';
class Discover extends React.Component {
constructor(props) {
@ -222,10 +223,7 @@ class Discover extends React.Component {
},
} = this.props;
// Rejoin if we've had to uri-encode these as strings
// We'd need to do this if our URL has been encoded so the whole URL can become
// it's own URI (eg iris:discover:spotify_artist_1234) where we can't use ":"
const seeds = seedsProp.split('_').join(':').split(',');
const seeds = seedsProp.split(',').map((uri) => decodeUri(uri));
loadUris(seeds);
this.setState(