Apply .toImmutableList() only once.

This commit is contained in:
Benoit Marty
2024-05-28 14:12:46 +02:00
parent 25c20f1734
commit 144895d5b4

View File

@@ -87,7 +87,7 @@ class NotificationSettingsPresenter @Inject constructor(
}
// List of Distributor names
val distributorNames = remember {
distributors.map { it.second.name }
distributors.map { it.second.name }.toImmutableList()
}
var currentDistributorName by remember { mutableStateOf<AsyncAction<String>>(AsyncAction.Uninitialized) }
@@ -164,7 +164,7 @@ class NotificationSettingsPresenter @Inject constructor(
),
changeNotificationSettingAction = changeNotificationSettingAction.value,
currentPushDistributor = currentDistributorName,
availablePushDistributors = distributorNames.toImmutableList(),
availablePushDistributors = distributorNames,
showChangePushProviderDialog = showChangePushProviderDialog,
eventSink = ::handleEvents
)