feat(scope): make Belgium and North Sea operational default
This commit is contained in:
@@ -59,8 +59,17 @@ export function useSegmentationWorkflow({
|
||||
try {
|
||||
const response = await segmentationApi.listModels()
|
||||
setSegmentationModels(response.models)
|
||||
if (!response.models.some((model) => model.model_id === selectedSegmentationModelId) && response.models.length > 0) {
|
||||
setSelectedSegmentationModelId(response.models[0].model_id)
|
||||
const selectionStillAvailable = response.models.some((model) => model.model_id === selectedSegmentationModelId)
|
||||
const selectionConfigured = response.models.some(
|
||||
(model) => model.model_id === selectedSegmentationModelId && model.configured,
|
||||
)
|
||||
if ((!selectionStillAvailable || !selectionConfigured) && response.models.length > 0) {
|
||||
const configuredModel = response.models.find(
|
||||
(model) => model.configured && model.model_id !== 'fixture-segmenter',
|
||||
)
|
||||
setSelectedSegmentationModelId(
|
||||
configuredModel?.model_id ?? (selectionStillAvailable ? selectedSegmentationModelId : response.models[0].model_id),
|
||||
)
|
||||
}
|
||||
} catch (error) {
|
||||
setSegmentationModelError(formatError(error, 'Failed to load segmentation models'))
|
||||
|
||||
Reference in New Issue
Block a user