feat: add drag and drop errors
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user