Minor cleanup. WIP

pull/991/head
Rick Carlino 2018-09-17 15:28:59 -05:00
parent bb8ed8afac
commit 9352e40769
5 changed files with 5 additions and 4 deletions

View File

@ -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 }));
}

View File

@ -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);

View File

@ -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 };

View File

@ -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) {

View File

@ -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>;
}
}
}