refactor: debounce writing to disk

This commit is contained in:
Carlos Valente
2026-02-01 18:20:22 +01:00
committed by Carlos Valente
parent e16ec3f388
commit 77779a4648
4 changed files with 65 additions and 21 deletions
@@ -486,7 +486,7 @@ export async function editCustomField(
if (rundownId !== rundown.id) {
const backgroundRundown = structuredClone(projectRundowns[rundownId]);
customFieldMutation.renameUsages(backgroundRundown, oldKey, newKey);
updateBackgroundRundown(rundownId, backgroundRundown);
await updateBackgroundRundown(rundownId, backgroundRundown);
}
}
@@ -526,7 +526,7 @@ export async function deleteCustomField(key: CustomFieldKey, projectRundowns: Pr
if (rundownId !== rundown.id) {
const backgroundRundown = structuredClone(projectRundowns[rundownId]);
customFieldMutation.removeUsages(backgroundRundown, key);
updateBackgroundRundown(rundownId, backgroundRundown);
await updateBackgroundRundown(rundownId, backgroundRundown);
}
}