mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
Only create aliases when they exist
This commit is contained in:
@@ -184,9 +184,11 @@ class AddExerciseProvider with ChangeNotifier {
|
||||
exerciseTranslationLang.base = base;
|
||||
exerciseTranslationLang = await addExerciseTranslation(exerciseTranslationLang);
|
||||
for (final alias in _alternativeNamesTranslation) {
|
||||
exerciseTranslationLang.alias.add(
|
||||
await addExerciseAlias(alias, exerciseTranslationLang.id!),
|
||||
);
|
||||
if (alias.isNotEmpty) {
|
||||
exerciseTranslationLang.alias.add(
|
||||
await addExerciseAlias(alias, exerciseTranslationLang.id!),
|
||||
);
|
||||
}
|
||||
}
|
||||
await addExerciseTranslation(exerciseTranslationLang);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user