mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(AdminSettings/AI): show pref list of only the enabled translation providers
Signed-off-by: Anupam Kumar <kyteinsky@gmail.com>
This commit is contained in:
parent
c52b7e5ebc
commit
cf4326539e
1 changed files with 6 additions and 1 deletions
|
|
@ -148,7 +148,12 @@ class ArtificialIntelligence implements IDelegatedSettings {
|
|||
$value = array_merge($defaultValue, $value);
|
||||
break;
|
||||
case 'ai.translation_provider_preferences':
|
||||
$value += array_diff($defaultValue, $value); // Add entries from $defaultValue that are not in $value to the end of $value
|
||||
// Only show entries from $value (saved pref list) that are in $defaultValue (enabled providers)
|
||||
// and add all providers that are enabled but not in the pref list
|
||||
if (!is_array($defaultValue)) {
|
||||
break;
|
||||
}
|
||||
$value = array_values(array_unique(array_merge(array_intersect($value, $defaultValue), $defaultValue), SORT_STRING));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue