fix: unresolved audio annotations labels

feat/type-attributes
Tomáš Mládek 2023-04-23 22:57:36 +02:00
parent c4fbb0bcbc
commit ddb7af116b
1 changed files with 8 additions and 5 deletions

View File

@ -94,10 +94,7 @@
const label = `Annotation #${nextAnnotationIndex}`;
region.update({
attributes: {
"upend-address": entity,
label,
},
attributes: { label },
} as any); // incorrect types, `update()` does take `attributes`
}
@ -126,6 +123,12 @@
if (Object.values(region.data).length) {
await putEntityAttribute(entity, "NOTE", region.data as IValue);
}
region.update({
attributes: {
"upend-address": entity,
},
} as any);
}
const updateAnnotationDebounced = debounce(updateAnnotation, 250);
@ -243,7 +246,7 @@
console.warn(`Failed to load peaks: ${e}`);
const entity = await fetchEntity(address);
if (
(entity.get("FILE_SIZE") || 0) < 20_000_000 ||
(parseInt(String(entity.get("FILE_SIZE"))) || 0) < 20_000_000 ||
confirm(
$i18n.t(
"File is large (>20 MiB) and UpEnd failed to load waveform from server. Generating the waveform locally may slow down your browser. Do you wish to proceed anyway?"