import type { UpdateQueueTasksMessage } from "@codeflash/types";
import type { State } from "../root";

export const handleUpdateQueueTasks = (
  oldState: State,
  message: UpdateQueueTasksMessage,
): State => {
  const newTasks = message.payload.tasks;
  // console.log(
  //   `received update queue tasks message: ${message.type}, ${JSON.stringify(newTasks)}`,
  // );
  return { ...oldState, queueTasks: newTasks };
};
