feat: add drag and drop errors

This commit is contained in:
2025-11-03 15:26:09 +01:00
parent 74053b695a
commit c361505175
6 changed files with 283 additions and 85 deletions
+4 -3
View File
@@ -284,8 +284,9 @@ export const normalizeStructureType = (value) => {
return sanitized;
};
export const sanitizeStructureList = (structure = []) => {
export const sanitizeStructureList = (structure = [], options = {}) => {
if (!Array.isArray(structure)) return [];
const { autoInjectPreChorus = true } = options || {};
const output = [];
let shouldInjectInstrumentalPreChorus = false;
@@ -311,7 +312,7 @@ export const sanitizeStructureList = (structure = []) => {
}
}
if (type === "pre_refrain_instrumental") {
if (type === "pre_refrain_instrumental" && autoInjectPreChorus) {
shouldInjectInstrumentalPreChorus = true;
return;
}
@@ -321,7 +322,7 @@ export const sanitizeStructureList = (structure = []) => {
let result = output;
if (shouldInjectInstrumentalPreChorus) {
if (autoInjectPreChorus && shouldInjectInstrumentalPreChorus) {
const expanded = [];
let hasRefrain = false;