Initial setup history; Removing baseURL

This commit is contained in:
James Barnsley
2019-01-24 16:37:10 +13:00
parent 05d3d0c549
commit 5e6a9567e8
11 changed files with 18330 additions and 12628 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@
// Release details // Release details
// These are automatically injected to built HTML // These are automatically injected to built HTML
var build = "1548233333"; var build = "1548287948";
var version = "3.31.8"; var version = "3.31.8";
// Construct the script tag // Construct the script tag

View File

@ -123,7 +123,7 @@ class App extends React.Component{
// Allow 100ms for the action above to complete before we re-route // Allow 100ms for the action above to complete before we re-route
setTimeout( setTimeout(
() => { () => {
this.props.history.push(global.baseURL); this.props.history.push('/');
}, },
100 100
); );

View File

@ -110,7 +110,7 @@ export default class GridItem extends React.Component{
if (this.props.link){ if (this.props.link){
var link = this.props.link; var link = this.props.link;
} else { } else {
var link = global.baseURL+this.props.type+'/'+encodeURIComponent(item.uri); var link = '/'+this.props.type+'/'+encodeURIComponent(item.uri);
} }
return ( return (

View File

@ -1,12 +1,8 @@
/**
* Base-level application wrapper
**/
import React, { PropTypes } from 'react';; import React, { PropTypes } from 'react';;
import ReactDOM from 'react-dom';; import ReactDOM from 'react-dom';;
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import { createStore } from 'redux'; import { createStore } from 'redux';
//import { Router, Route, Link, IndexRoute, hashHistory } from 'react-router';
import { BrowserRouter, Route, IndexRoute } from "react-router-dom"; import { BrowserRouter, Route, IndexRoute } from "react-router-dom";
import store from './bootstrap.js'; import store from './bootstrap.js';
@ -14,8 +10,6 @@ require('../scss/app.scss');
import App from './App'; import App from './App';
global.baseURL = '/';
ReactDOM.render( ReactDOM.render(
<Provider store={store}> <Provider store={store}>
<BrowserRouter basename="/iris"> <BrowserRouter basename="/iris">

View File

@ -361,8 +361,6 @@ const CoreMiddleware = (function(){
break; break;
case 'LOAD_ALBUM': case 'LOAD_ALBUM':
console.log(action);
if ( if (
!action.force_reload && !action.force_reload &&
store.getState().core.albums[action.uri] && store.getState().core.albums[action.uri] &&
@ -391,7 +389,6 @@ const CoreMiddleware = (function(){
break; break;
case 'LOAD_ARTIST': case 'LOAD_ARTIST':
if ( if (
!action.force_reload && !action.force_reload &&
store.getState().core.artists[action.uri] && store.getState().core.artists[action.uri] &&
@ -421,7 +418,6 @@ const CoreMiddleware = (function(){
break; break;
case 'LOAD_PLAYLIST': case 'LOAD_PLAYLIST':
if ( if (
!action.force_reload && !action.force_reload &&
store.getState().core.playlists[action.uri] && store.getState().core.playlists[action.uri] &&

View File

@ -182,7 +182,7 @@ class Artist extends React.Component{
<div className="col col--w5"></div> <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> <div className="cf"></div>

View File

@ -35,6 +35,7 @@ class InitialSetup extends React.Component{
handleSubmit(e){ handleSubmit(e){
e.preventDefault(); e.preventDefault();
var self = this; var self = this;
// Force local username change, even if remote connection absent/failed // Force local username change, even if remote connection absent/failed
@ -52,18 +53,19 @@ class InitialSetup extends React.Component{
this.setState({saving: true}); this.setState({saving: true});
// Wait a jiffy to allow changes to apply to store // Wait a jiffy to allow changes to apply to store
setTimeout(function(){ setTimeout(() => {
// We've changed a connection setting, so need to reload // We've changed a connection setting, so need to reload
if (self.state.host !== self.props.host || self.state.port !== self.props.port){ 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 {
// Safe to just close modal self.props.history.push('/');
} else { }
this.props.history.push(global.baseURL); },
} 200
}, 200); );
return false; return false;
} }