Done. Closes #1272

pull/1274/head
Rick Carlino 2019-07-15 16:23:06 -05:00
parent e2b5690471
commit ebaa3c675d
2 changed files with 4 additions and 10 deletions

View File

@ -18,7 +18,7 @@ import {
} from "../farmware/state_to_props";
import { getFbosConfig, getFirmwareConfig } from "../resources/getters";
import { DevSettings } from "../account/dev/dev_support";
import { getApiAlerts, getLocalAlerts } from "../messages/state_to_props";
import { getAllAlerts } from "../messages/state_to_props";
export function mapStateToProps(props: Everything): Props {
const { hardware } = props.bot;
@ -50,9 +50,6 @@ export function mapStateToProps(props: Everything): Props {
env,
saveFarmwareEnv: saveOrEditFarmwareEnv(props.resources.index),
timeSettings: maybeGetTimeSettings(props.resources.index),
alerts: [
...getLocalAlerts(props.resources.consumers.alerts),
...getApiAlerts(props.resources.index)
],
alerts: getAllAlerts(props.resources),
};
}

View File

@ -23,15 +23,12 @@ describe("Contextual `Alert` creation", () => {
});
it("toggles off", () => {
// OVERWRITE_RESOURCE
const c = fakeFbosConfig();
const s: AlertReducerState = {
alerts: {}
};
const action = overwrite(c, {
...c.body,
firmware_hardware: "none"
});
const action =
overwrite(c, { ...c.body, firmware_hardware: "none" });
const { alerts } = alertsReducer(s, action);
const results = Object.values(alerts);
expect(results[0]).toEqual(undefined);