Make the server setting model a local val

This commit is contained in:
tzugen 2021-05-04 09:49:47 +02:00
parent 9ca15deef2
commit a6c914cf7f
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
1 changed files with 1 additions and 1 deletions

View File

@ -93,7 +93,6 @@ class SelectAlbumFragment : Fragment() {
private var cancellationToken: CancellationToken? = null
private val activeServerProvider: ActiveServerProvider by inject()
private val serverSettingsModel: ServerSettingsModel by viewModel()
private val model: SelectAlbumModel by viewModels()
private val random: Random = SecureRandom()
@ -133,6 +132,7 @@ class SelectAlbumFragment : Fragment() {
requireContext(), view as ViewGroup
) { selectedFolderId ->
if (!isOffline(context)) {
val serverSettingsModel: ServerSettingsModel by viewModel()
val currentSetting = activeServerProvider.getActiveServer()
currentSetting.musicFolderId = selectedFolderId
serverSettingsModel.updateItem(currentSetting)