Initial setup history; Removing baseURL
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
43
mopidy_iris/static/app.min.js
vendored
43
mopidy_iris/static/app.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -98,7 +98,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1548233333";
|
||||
var build = "1548287948";
|
||||
var version = "3.31.8";
|
||||
|
||||
// Construct the script tag
|
||||
|
||||
@ -123,7 +123,7 @@ class App extends React.Component{
|
||||
// Allow 100ms for the action above to complete before we re-route
|
||||
setTimeout(
|
||||
() => {
|
||||
this.props.history.push(global.baseURL);
|
||||
this.props.history.push('/');
|
||||
},
|
||||
100
|
||||
);
|
||||
|
||||
@ -110,7 +110,7 @@ export default class GridItem extends React.Component{
|
||||
if (this.props.link){
|
||||
var link = this.props.link;
|
||||
} else {
|
||||
var link = global.baseURL+this.props.type+'/'+encodeURIComponent(item.uri);
|
||||
var link = '/'+this.props.type+'/'+encodeURIComponent(item.uri);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
/**
|
||||
* Base-level application wrapper
|
||||
**/
|
||||
|
||||
import React, { PropTypes } from 'react';;
|
||||
import ReactDOM from 'react-dom';;
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore } from 'redux';
|
||||
//import { Router, Route, Link, IndexRoute, hashHistory } from 'react-router';
|
||||
import { BrowserRouter, Route, IndexRoute } from "react-router-dom";
|
||||
|
||||
import store from './bootstrap.js';
|
||||
@ -14,8 +10,6 @@ require('../scss/app.scss');
|
||||
|
||||
import App from './App';
|
||||
|
||||
global.baseURL = '/';
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<BrowserRouter basename="/iris">
|
||||
|
||||
@ -361,8 +361,6 @@ const CoreMiddleware = (function(){
|
||||
break;
|
||||
|
||||
case 'LOAD_ALBUM':
|
||||
console.log(action);
|
||||
|
||||
if (
|
||||
!action.force_reload &&
|
||||
store.getState().core.albums[action.uri] &&
|
||||
@ -391,7 +389,6 @@ const CoreMiddleware = (function(){
|
||||
break;
|
||||
|
||||
case 'LOAD_ARTIST':
|
||||
|
||||
if (
|
||||
!action.force_reload &&
|
||||
store.getState().core.artists[action.uri] &&
|
||||
@ -421,7 +418,6 @@ const CoreMiddleware = (function(){
|
||||
break;
|
||||
|
||||
case 'LOAD_PLAYLIST':
|
||||
|
||||
if (
|
||||
!action.force_reload &&
|
||||
store.getState().core.playlists[action.uri] &&
|
||||
|
||||
@ -182,7 +182,7 @@ class Artist extends React.Component{
|
||||
|
||||
<div className="col col--w5"></div>
|
||||
|
||||
{artist.related_artists && artist.related_artists.length > 0 ? <div className="col col--w25 related-artists"><h4>Related artists</h4><div className="list-wrapper"><RelatedArtists artists={artist.related_artists.slice(0,6)} /></div><Link to={'/artist/'+artist.uri+'/related-artists'} scrollTo="sub-views-menu" className="button button--default">All related artists</Link></div> : null}
|
||||
{artist.related_artists && artist.related_artists.length > 0 ? <div className="col col--w25 related-artists"><h4>Related artists</h4><div className="list-wrapper"><RelatedArtists artists={artist.related_artists.slice(0,6)} /></div><Link to={'/artist/'+encodeURIComponent(this.props.uri)+'/related-artists'} scrollTo="sub-views-menu" className="button button--default">All related artists</Link></div> : null}
|
||||
|
||||
<div className="cf"></div>
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@ class InitialSetup extends React.Component{
|
||||
|
||||
handleSubmit(e){
|
||||
e.preventDefault();
|
||||
|
||||
var self = this;
|
||||
|
||||
// Force local username change, even if remote connection absent/failed
|
||||
@ -52,18 +53,19 @@ class InitialSetup extends React.Component{
|
||||
this.setState({saving: true});
|
||||
|
||||
// Wait a jiffy to allow changes to apply to store
|
||||
setTimeout(function(){
|
||||
setTimeout(() => {
|
||||
|
||||
// We've changed a connection setting, so need to reload
|
||||
if (self.state.host !== self.props.host || self.state.port !== self.props.port){
|
||||
// We've changed a connection setting, so need to reload
|
||||
if (self.state.host !== self.props.host || self.state.port !== self.props.port){
|
||||
window.location = '/';
|
||||
|
||||
window.location = global.baseURL;
|
||||
|
||||
// Safe to just close modal
|
||||
} else {
|
||||
this.props.history.push(global.baseURL);
|
||||
}
|
||||
}, 200);
|
||||
// Safe to just close modal
|
||||
} else {
|
||||
self.props.history.push('/');
|
||||
}
|
||||
},
|
||||
200
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user