Skip to content

Commit

Permalink
fix: Duration not calculated in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nesadrian committed Jun 24, 2024
1 parent d8f49f3 commit 34353a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/canvas/utils/setMainActivitiesDurationSum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const roundDurations = (sumDurations: typeof timeDefinitions) => {
const minutes = sumDurations.find((d) => d.value === "Minute")?.duration;
if (minutes) {
const hoursToAdd = Math.floor(minutes / 60);
return sumDurations.map((dur) => {
sumDurations = sumDurations.map((dur) => {
switch (dur.value) {
case "Minute":
dur.duration -= hoursToAdd * 60;
Expand All @@ -35,6 +35,7 @@ const roundDurations = (sumDurations: typeof timeDefinitions) => {
return dur;
});
}
return sumDurations;
};

export const setMainActivitiesDurationSum = (nodes: Node[]) => {
Expand Down

0 comments on commit 34353a3

Please sign in to comment.