Minor cleanup. WIP
parent
bb8ed8afac
commit
9352e40769
|
@ -77,7 +77,6 @@ export class SpreadCircle extends
|
|||
|
||||
componentWillMount = () => {
|
||||
this.isClear = true;
|
||||
// NOTE: The error still happens here:
|
||||
cachedCrop(this.props.plant.body.openfarm_slug)
|
||||
.then(({ spread }) => this.isClear && this.setState({ spread }));
|
||||
}
|
||||
|
|
|
@ -86,7 +86,6 @@ export class FarmwarePage extends React.Component<FarmwareProps, {}> {
|
|||
get current() { return this.props.currentFarmware; }
|
||||
|
||||
componentWillMount() {
|
||||
console.warn("Do we still need this? - RC");
|
||||
if (!this.current && Object.values(this.props.farmwares).length > 0) {
|
||||
const farmwareNames = Object.values(this.props.farmwares)
|
||||
.map(x => x && x.name);
|
||||
|
|
|
@ -5,5 +5,5 @@ export const push = (url: string) => navigate(maybeStripLegacyUrl(url));
|
|||
|
||||
export const getPathArray = () => location.pathname.split("/");
|
||||
|
||||
/** This is a stub from the `react-router`. Don't use it anymore. */
|
||||
/** This is a stub from the `react-router` days. Don't use it anymore. */
|
||||
export const history = { push, getCurrentLocation: () => window.location };
|
||||
|
|
|
@ -79,8 +79,11 @@ function legacyRoute<T>(i: LegacyRouteCfg<T>) {
|
|||
try {
|
||||
// tslint:disable-next-line:no-any
|
||||
const El: any = (await getChild())[key];
|
||||
// ^ Let route() / legacyRoute() catch type issues.
|
||||
|
||||
// tslint:disable-next-line:no-any
|
||||
const stub: any = { children: <El /> };
|
||||
// ^ react-redux will mutate the real props behind the scenes.
|
||||
const { FarmDesigner } = await import("./farm_designer");
|
||||
callback(() => <FarmDesigner {...stub} />, info);
|
||||
} catch (e) {
|
||||
|
|
|
@ -56,7 +56,7 @@ export class RootComponent extends React.Component<RootComponentProps, RootCompo
|
|||
</Provider>
|
||||
</ErrorBoundary>;
|
||||
} catch (error) {
|
||||
return <p> Kaboom!</p>;
|
||||
return <p> Problem loading page.</p>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue