release test fixes (#496)

* refactor: handle missing type

* fix: prevent stale data on cancel delay
This commit is contained in:
Carlos Valente
2023-08-24 22:53:23 +02:00
committed by GitHub
parent 1d4dc3a26f
commit af99882919
3 changed files with 6 additions and 4 deletions
@@ -132,12 +132,13 @@ export async function cachedDelete(eventId: string) {
}
let updatedRundown = DataProvider.getRundown();
const eventBack = { ...updatedRundown[eventIndex] };
updatedRundown = deleteAtIndex(eventIndex, updatedRundown);
if (eventId !== delayedRundown[eventIndex].id) {
invalidateFromError();
} else {
delayedRundown = deleteAtIndex(eventIndex, delayedRundown);
if (isOntimeDelay(updatedRundown[eventIndex]) || isOntimeBlock(updatedRundown[eventIndex])) {
if (isOntimeDelay(eventBack) || isOntimeBlock(eventBack)) {
// for events, we do not have to worry
// the following event, would have taken the place of the deleted event by now
delayedRundown = calculateRuntimeDelaysFromIndex(eventIndex, delayedRundown);