Merge branch 'dev' into feat/dataset-explorer

This commit is contained in:
Armen Rohalov
2026-05-14 20:26:20 +03:00
383 changed files with 40090 additions and 923 deletions
+4 -3
View File
@@ -1,7 +1,8 @@
import { useRef, useEffect, useState, useCallback, forwardRef, useImperativeHandle } from 'react'
import { endpoints } from '../../api'
import { MediaType } from '../../types'
import type { Media, AnnotationListItem, Detection, Affiliation, CombatReadiness } from '../../types'
import { getClassColor, getPhotoModeSuffix, getClassNameFallback } from './classColors'
import { getClassColor, getPhotoModeSuffix, getClassNameFallback } from '../../class-colors'
interface Props {
media: Media
@@ -77,11 +78,11 @@ const CanvasEditor = forwardRef<CanvasEditorHandle, Props>(function CanvasEditor
img.crossOrigin = 'anonymous'
const isLocalPath = media.path.startsWith('blob:') || media.path.startsWith('data:')
if (annotation && !isLocalPath) {
img.src = `/api/annotations/annotations/${annotation.id}/image`
img.src = endpoints.annotations.annotationImage(annotation.id)
} else if (isLocalPath) {
img.src = media.path
} else {
img.src = `/api/annotations/media/${media.id}/file`
img.src = endpoints.annotations.mediaFile(media.id)
}
img.onload = () => {
imgRef.current = img