[ui] fix annotation error on img reload

feat/vaults
Tomáš Mládek 2022-02-17 15:12:45 +01:00
parent 1a38d4f66e
commit bd24f1f01d
1 changed files with 5 additions and 3 deletions

View File

@ -25,6 +25,7 @@
) => void);
clearAnnotations: () => void;
readOnly: boolean;
destroy: () => void;
}
interface W3cAnnotation {
@ -77,11 +78,12 @@
let a8sLinkAddress: string;
async function loaded() {
if (imageLoaded) return;
imageLoaded = true;
const { Annotorious } = await import("@recogito/annotorious");
if (anno) {
anno.destroy();
}
anno = new Annotorious({
image: imageEl,
drawOnSingleClick: true,