Skip to content

The open-source AI voice studio. Clone, dictate, create.

fix: warn user when no models to migrate during storage change (#433)

Chris Chen882cabc7d2d3
diff --git a/app/src/components/ServerSettings/ModelManagement.tsx b/app/src/components/ServerSettings/ModelManagement.tsx
index d3fe24fa..9893984d 100644
--- a/app/src/components/ServerSettings/ModelManagement.tsx
+++ b/app/src/components/ServerSettings/ModelManagement.tsx
@@ -977,7 +977,19 @@ export function ModelManagement() {
});
try {
// Start the migration (background task)
- await apiClient.migrateModels(newDir);
+ const migrationResult = await apiClient.migrateModels(newDir);
+
+ // If no models to migrate, warn user and skip the change
+ if (migrationResult.moved === 0) {
+ setMigrating(false);
+ setMigrationProgress(null);
+ toast({
+ title: 'No models to migrate',
+ description: 'Download at least one model before changing the storage location.',
+ });
+ setPendingMigrateDir(null);
+ return;
+ }
// Connect to SSE for progress
await new Promise<void>((resolve, reject) => {