Fixing library URI setting (destructuring), possibly related to #571
This commit is contained in:
@ -116249,6 +116249,8 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
@ -116284,6 +116286,14 @@ var Settings = function (_React$Component) {
|
||||
setLanguage(language);
|
||||
};
|
||||
|
||||
_this.onMopidySettingChanged = function (name, value) {
|
||||
var set = _this.props.mopidyActions.set;
|
||||
|
||||
var shortName = name.replace('mopidy_', '');
|
||||
set(_defineProperty({}, shortName, value));
|
||||
_this.setState(_defineProperty({}, name, value));
|
||||
};
|
||||
|
||||
_this.resetAllSettings = function () {
|
||||
localStorage.clear();
|
||||
window.location = '#';
|
||||
@ -116377,7 +116387,7 @@ var Settings = function (_React$Component) {
|
||||
|
||||
_this.render = function () {
|
||||
var _this$props = _this.props,
|
||||
mopidyActions = _this$props.mopidyActions,
|
||||
setMopidy = _this$props.mopidyActions.set,
|
||||
mopidy = _this$props.mopidy,
|
||||
_this$props$pusherAct = _this$props.pusherActions,
|
||||
setUsername = _this$props$pusherAct.setUsername,
|
||||
@ -116794,8 +116804,8 @@ var Settings = function (_React$Component) {
|
||||
{ className: 'input' },
|
||||
_react2.default.createElement(_TextField2.default, {
|
||||
value: _this.state.mopidy_library_artists_uri,
|
||||
onChange: function onChange(mopidy_library_artists_uri) {
|
||||
return _this.setState({ mopidy_library_artists_uri: mopidy_library_artists_uri });
|
||||
onChange: function onChange(value) {
|
||||
return _this.onMopidySettingChanged('mopidy_library_artists_uri', value);
|
||||
},
|
||||
autosave: true
|
||||
}),
|
||||
@ -116820,8 +116830,8 @@ var Settings = function (_React$Component) {
|
||||
_react2.default.createElement(_TextField2.default, {
|
||||
type: 'text',
|
||||
value: _this.state.mopidy_library_albums_uri,
|
||||
onChange: function onChange(mopidy_library_albums_uri) {
|
||||
return _this.setState({ mopidy_library_albums_uri: mopidy_library_albums_uri });
|
||||
onChange: function onChange(value) {
|
||||
return _this.onMopidySettingChanged('mopidy_library_albums_uri', value);
|
||||
},
|
||||
autosave: true
|
||||
}),
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
mopidy_iris/static/app.min.css
vendored
2
mopidy_iris/static/app.min.css
vendored
File diff suppressed because one or more lines are too long
10
mopidy_iris/static/app.min.js
vendored
10
mopidy_iris/static/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -106,7 +106,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1596271909";
|
||||
var build = "1596278065";
|
||||
var version = "3.50.0";
|
||||
|
||||
// Construct the script tag
|
||||
|
||||
@ -57,6 +57,17 @@ class Settings extends React.Component {
|
||||
setLanguage(language);
|
||||
}
|
||||
|
||||
onMopidySettingChanged = (name, value) => {
|
||||
const {
|
||||
mopidyActions: {
|
||||
set,
|
||||
},
|
||||
} = this.props;
|
||||
const shortName = name.replace('mopidy_','');
|
||||
set({ [shortName]: value });
|
||||
this.setState({ [name]: value });
|
||||
}
|
||||
|
||||
resetAllSettings = () => {
|
||||
localStorage.clear();
|
||||
window.location = '#';
|
||||
@ -128,7 +139,9 @@ class Settings extends React.Component {
|
||||
|
||||
render = () => {
|
||||
const {
|
||||
mopidyActions,
|
||||
mopidyActions: {
|
||||
set: setMopidy,
|
||||
},
|
||||
mopidy,
|
||||
pusherActions: {
|
||||
setUsername,
|
||||
@ -408,7 +421,7 @@ class Settings extends React.Component {
|
||||
<div className="input">
|
||||
<TextField
|
||||
value={this.state.mopidy_library_artists_uri}
|
||||
onChange={(mopidy_library_artists_uri) => this.setState({ mopidy_library_artists_uri })}
|
||||
onChange={(value) => this.onMopidySettingChanged('mopidy_library_artists_uri', value)}
|
||||
autosave
|
||||
/>
|
||||
<div className="description">
|
||||
@ -425,7 +438,7 @@ class Settings extends React.Component {
|
||||
<TextField
|
||||
type="text"
|
||||
value={this.state.mopidy_library_albums_uri}
|
||||
onChange={(mopidy_library_albums_uri) => this.setState({ mopidy_library_albums_uri })}
|
||||
onChange={(value) => this.onMopidySettingChanged('mopidy_library_albums_uri', value)}
|
||||
autosave
|
||||
/>
|
||||
<div className="description">
|
||||
|
||||
Reference in New Issue
Block a user