From 62dcf103248b5a50f57ffd6cd51f2df8dc4f7e99 Mon Sep 17 00:00:00 2001 From: stefano-lacorazza <112132737+stefano-lacorazza@users.noreply.github.com> Date: Tue, 24 Sep 2024 05:33:44 -0500 Subject: [PATCH] OV-349: * fix magic numbers --- .../src/bundles/studio/helpers/scenes-exceed-scripts.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/bundles/studio/helpers/scenes-exceed-scripts.ts b/frontend/src/bundles/studio/helpers/scenes-exceed-scripts.ts index ed6773451..832dcd6d3 100644 --- a/frontend/src/bundles/studio/helpers/scenes-exceed-scripts.ts +++ b/frontend/src/bundles/studio/helpers/scenes-exceed-scripts.ts @@ -1,16 +1,18 @@ import { type Scene, type Script } from '../types/types.js'; +const INITIAL_DURATION = 0; + const scenesExceedScripts = (scenes: Scene[], scripts: Script[]): boolean => { const totalScenesDuration = scenes.reduce( (accumulator, scene) => accumulator + scene.duration, - 0, + INITIAL_DURATION, ); const totalScriptsDuration = scripts.reduce( (accumulator, script) => accumulator + script.duration, - 0, + INITIAL_DURATION, ); return totalScenesDuration > totalScriptsDuration; }; -export { scenesExceedScripts }; +export { scenesExceedScripts }; \ No newline at end of file