Commit 6733323d authored by Matija Obreza's avatar Matija Obreza

Bugs

parent 5a200cee
...@@ -3,7 +3,7 @@ import { stringify } from 'query-string'; ...@@ -3,7 +3,7 @@ import { stringify } from 'query-string';
const IN_BROWSER = typeof window !== 'undefined'; const IN_BROWSER = typeof window !== 'undefined';
export function navigateTo(path: string, query?: object) { export function navigateTo(path: string, query?: Record<string, string | number | boolean>) {
return (dispatch, getState) => { return (dispatch, getState) => {
if (! IN_BROWSER) { if (! IN_BROWSER) {
console.log('Not navigating anywhere while on the server!'); console.log('Not navigating anywhere while on the server!');
......
...@@ -168,8 +168,8 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> { ...@@ -168,8 +168,8 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
public componentDidUpdate(prevProps: Readonly<IDisplayPageProps>): void { public componentDidUpdate(prevProps: Readonly<IDisplayPageProps>): void {
const { code: oldCode } = prevProps; const { code: oldCode } = prevProps;
const { code, loadInstitute, institute } = this.props; const { loading, code, loadInstitute, institute } = this.props;
if (code && (! institute || code !== institute.details.code) || code !== oldCode) { if (code && !loading && (!institute || code !== institute.details.code) || code !== oldCode) {
loadInstitute(code); loadInstitute(code);
} }
} }
...@@ -182,7 +182,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> { ...@@ -182,7 +182,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
let cropNameOverview; let cropNameOverview;
let taxonomyGenusOverview; let taxonomyGenusOverview;
let taxonomyGenusSpeciesOverview; let taxonomyGenusSpeciesOverview;
if (!loading) { if (!loading && institute) {
const cropShortNameKey = 'crop.shortName'; const cropShortNameKey = 'crop.shortName';
cropShortNameOverview = institute.overview[cropShortNameKey]; cropShortNameOverview = institute.overview[cropShortNameKey];
const cropNameKey = 'cropName'; const cropNameKey = 'cropName';
......
...@@ -7,7 +7,7 @@ import { updateHistory } from 'actions/history'; ...@@ -7,7 +7,7 @@ import { updateHistory } from 'actions/history';
import { loadCrops } from 'crop/actions/public'; import { loadCrops } from 'crop/actions/public';
import { initMyList } from 'list/actions/public'; import { initMyList } from 'list/actions/public';
import { initMyMaps } from 'accessions/actions/public'; import { initMyMaps } from 'accessions/actions/public';
import { checkSoftwareVersion, serverInfoRequest } from 'actions/serverInfo'; import { serverInfoRequest } from 'actions/serverInfo';
import { loadIso3Decodings, refreshIso3Decodings } from 'geo/actions/public'; import { loadIso3Decodings, refreshIso3Decodings } from 'geo/actions/public';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
...@@ -34,7 +34,6 @@ interface IAppProps extends React.ClassAttributes<any>, WithTranslation { ...@@ -34,7 +34,6 @@ interface IAppProps extends React.ClassAttributes<any>, WithTranslation {
loadIso3Decodings: (lang: string) => void; loadIso3Decodings: (lang: string) => void;
serverInfo: any; serverInfo: any;
serverInfoRequest: any; serverInfoRequest: any;
checkSoftwareVersion: any;
initMyMaps: any; initMyMaps: any;
refreshIso3Decodings: (lang: string) => void; refreshIso3Decodings: (lang: string) => void;
lang: string; lang: string;
...@@ -47,7 +46,7 @@ class App extends React.Component<IAppProps, any> { ...@@ -47,7 +46,7 @@ class App extends React.Component<IAppProps, any> {
} }
public componentDidMount() { public componentDidMount() {
const { initMyList, checkSoftwareVersion , initMyMaps, refreshIso3Decodings, lang } = this.props; const { initMyList, initMyMaps, refreshIso3Decodings, lang } = this.props;
const { crops, loadCrops, serverInfo, serverInfoRequest} = this.props; const { crops, loadCrops, serverInfo, serverInfoRequest} = this.props;
if (! crops || crops.length === 0) { if (! crops || crops.length === 0) {
loadCrops(); loadCrops();
...@@ -60,8 +59,6 @@ class App extends React.Component<IAppProps, any> { ...@@ -60,8 +59,6 @@ class App extends React.Component<IAppProps, any> {
initMyList(); initMyList();
initMyMaps(); initMyMaps();
refreshIso3Decodings(lang); refreshIso3Decodings(lang);
console.log('Loading software version');
checkSoftwareVersion();
} }
public componentDidUpdate(prevProps: IAppProps) { public componentDidUpdate(prevProps: IAppProps) {
...@@ -114,7 +111,6 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({ ...@@ -114,7 +111,6 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
loadCrops, loadCrops,
initMyList, initMyList,
serverInfoRequest, serverInfoRequest,
checkSoftwareVersion,
loadIso3Decodings, loadIso3Decodings,
initMyMaps, initMyMaps,
refreshIso3Decodings, refreshIso3Decodings,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment