mirror of
https://github.com/moghtech/komodo.git
synced 2026-07-18 15:32:37 -05:00
get build updates on relevant deployment over ws
This commit is contained in:
@@ -4,19 +4,23 @@ import Grid from "../util/layout/Grid";
|
||||
import Update from "../update/Update";
|
||||
import { getUpdates } from "../../util/query";
|
||||
import { useAppState } from "../../state/StateProvider";
|
||||
import { ADD_UPDATE } from "@monitor/util";
|
||||
import { ADD_UPDATE, BUILD } from "@monitor/util";
|
||||
import { useTheme } from "../../state/ThemeProvider";
|
||||
import { combineClasses } from "../../util/helpers";
|
||||
import Button from "../util/Button";
|
||||
|
||||
const Updates: Component<{}> = (p) => {
|
||||
const { ws, selected } = useAppState();
|
||||
const { ws, selected, deployments } = useAppState();
|
||||
const selectedUpdates = useArray(() =>
|
||||
getUpdates({ deploymentID: selected.id() })
|
||||
);
|
||||
const buildID = () => deployments.get(selected.id())?.buildID;
|
||||
onCleanup(
|
||||
ws.subscribe([ADD_UPDATE], ({ update }) => {
|
||||
if (update.deploymentID === selected.id()) {
|
||||
if (
|
||||
update.deploymentID === selected.id() ||
|
||||
(buildID() && buildID() === update.buildID && update.operation === BUILD)
|
||||
) {
|
||||
selectedUpdates.add(update);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user