Manually adding seeds using coreActions; Fixing removal of seeds

This commit is contained in:
James Barnsley
2017-09-21 08:24:33 +12:00
parent a45b67776f
commit 3371a6bb2b
3 changed files with 21 additions and 13 deletions

View File

@ -43,15 +43,6 @@
var build = "BUILD_HERE";
var version = "VERSION_HERE";
// Initiate error tracking. This helps catch errors early so
// patches can accurately and quickly fix issues.
Raven.config(
'https://023e3bf7721b48f29948545fc36a4621@sentry.io/219026',
{
release: version+"_"+build
}
).install();
// Construct the script tag
var js = document.createElement("script");
js.type = "application/javascript";
@ -60,11 +51,26 @@
var css = document.createElement("link");
css.rel = "stylesheet";
// Identify whether we're in test mode, and need to fetch non-minified assets
// Check for test mode. This is toggled under Settings > Debug > Test mode
var ui = JSON.parse( localStorage.getItem('ui') );
// Test mode either not enabled, or not configured
if (typeof(ui) === 'undefined' || !ui || typeof(ui.test_mode) === 'undefined' || !ui.test_mode){
// Production-grade, minified app
js.src = '/iris/app.min.js?v='+build;
css.href = '/iris/app.min.css?v='+build;
// Initiate error tracking. This helps catch errors early so
// patches can accurately and quickly fix issues.
Raven.config(
'https://023e3bf7721b48f29948545fc36a4621@sentry.io/219026',
{
release: version+"_"+build
}
).install();
// We're in test mode, so use built (but not minified) code
} else {
js.src = '/iris/app.js?v='+build;
css.href = '/iris/app.css?v='+build;

View File

@ -6,6 +6,7 @@ import { Link, hashHistory } from 'react-router'
import ArtistSentence from './ArtistSentence'
import * as helpers from '../helpers'
import * as coreActions from '../services/core/actions'
import * as uiActions from '../services/ui/actions'
import * as spotifyActions from '../services/spotify/actions'
@ -67,11 +68,11 @@ class AddSeedField extends React.Component{
switch (helpers.uriType(item.uri)){
case 'artist':
this.props.uiActions.artistLoaded(item.uri,item)
this.props.coreActions.artistLoaded(item.uri,item)
break
case 'track':
this.props.uiActions.trackLoaded(item.uri,item)
this.props.coreActions.trackLoaded(item.uri,item)
break
}
}
@ -143,6 +144,7 @@ const mapStateToProps = (state, ownProps) => {
const mapDispatchToProps = (dispatch) => {
return {
coreActions: bindActionCreators(coreActions, dispatch),
uiActions: bindActionCreators(uiActions, dispatch),
spotifyActions: bindActionCreators(spotifyActions, dispatch)
}

View File

@ -157,7 +157,7 @@ class Discover extends React.Component{
<span className="seed" key={seed.uri}>
{seed.name}
<span className="type">({type})</span>
<FontAwesome name="close" className="remove" onClick={() => this.removeSeed(seed.uri)} />
<FontAwesome name="close" className="remove" onClick={() => this.removeSeed(index)} />
</span>
)
})