Skip to content

Commit

Permalink
refactor: removed 3 unnecessary declarations of spacesListViewModel
Browse files Browse the repository at this point in the history
  • Loading branch information
joragua committed Nov 5, 2024
1 parent 97d42ef commit 21b7089
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import org.koin.android.ext.android.inject
import org.koin.androidx.viewmodel.ext.android.getViewModel
import org.koin.androidx.viewmodel.ext.android.viewModel
import org.koin.core.parameter.parametersOf
import timber.log.Timber
Expand Down Expand Up @@ -183,6 +184,7 @@ class FileDisplayActivity : FileActivity(),

private val fileOperationsViewModel: FileOperationsViewModel by viewModel()
private val transfersViewModel: TransfersViewModel by viewModel()
private lateinit var spacesListViewModel : SpacesListViewModel

private val sharedPreferences: SharedPreferencesProvider by inject()

Expand Down Expand Up @@ -379,9 +381,7 @@ class FileDisplayActivity : FileActivity(),
}
}

val spacesListViewModel: SpacesListViewModel by viewModel {
parametersOf(account.name, false)
}
spacesListViewModel = getViewModel { parametersOf(account.name, false) }
spacesListViewModel.refreshSpacesFromServer()
}

Expand Down Expand Up @@ -1007,7 +1007,6 @@ class FileDisplayActivity : FileActivity(),
}

// Refresh the spaces and update the quota
val spacesListViewModel: SpacesListViewModel by viewModel { parametersOf(account.name, false) }
spacesListViewModel.refreshSpacesFromServer()

invalidateOptionsMenu()
Expand Down Expand Up @@ -1045,7 +1044,6 @@ class FileDisplayActivity : FileActivity(),
}

// Refresh the spaces and update the quota
val spacesListViewModel: SpacesListViewModel by viewModel { parametersOf(account.name, false) }
spacesListViewModel.refreshSpacesFromServer()
}
}
Expand Down Expand Up @@ -1086,7 +1084,6 @@ class FileDisplayActivity : FileActivity(),
}

// Refresh the spaces and update the quota
val spacesListViewModel: SpacesListViewModel by viewModel { parametersOf(account.name, false) }
spacesListViewModel.refreshSpacesFromServer()
}

Expand Down

0 comments on commit 21b7089

Please sign in to comment.