Skip to content

Commit

Permalink
fix: activitybar does not reset correctly when an in-progress operati…
Browse files Browse the repository at this point in the history
…on is deleted
  • Loading branch information
garethgeorge committed Aug 15, 2024
1 parent 62a97a3 commit 244fe7e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webui/src/components/ActivityBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { formatDuration } from "../lib/formatting";
import {
Operation,
OperationEvent,
OperationEventType,
OperationStatus,
} from "../../gen/ts/v1/operations_pb";

Expand All @@ -20,11 +21,15 @@ export const ActivityBar = () => {
useEffect(() => {
const callback = (event?: OperationEvent, err?: Error) => {
if (!event || !event.operation) return;

const operation = event.operation;

setActiveOperations((ops) => {
ops = ops.filter((op) => op.id !== operation.id);
if (operation.status === OperationStatus.STATUS_INPROGRESS) {
if (
event.type !== OperationEventType.EVENT_DELETED &&
operation.status === OperationStatus.STATUS_INPROGRESS
) {
ops.push(operation);
}
ops.sort((a, b) => Number(b.unixTimeStartMs - a.unixTimeStartMs));
Expand Down

0 comments on commit 244fe7e

Please sign in to comment.