mirror of
https://github.com/bitwarden/android.git
synced 2024-11-24 02:15:53 +03:00
Remove accidental usages of viewModel() in favor of hiltViewModel() (#47)
This commit is contained in:
parent
a358408ea7
commit
f709e55ae6
2 changed files with 4 additions and 4 deletions
|
@ -16,8 +16,8 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import com.x8bit.bitwarden.R
|
||||
import com.x8bit.bitwarden.ui.platform.base.util.EventsEffect
|
||||
import com.x8bit.bitwarden.ui.platform.components.BitwardenTextField
|
||||
|
@ -29,7 +29,7 @@ import com.x8bit.bitwarden.ui.platform.components.BitwardenTextField
|
|||
@Suppress("LongMethod")
|
||||
fun LoginScreen(
|
||||
onNavigateToLanding: () -> Unit,
|
||||
viewModel: LoginViewModel = viewModel(),
|
||||
viewModel: LoginViewModel = hiltViewModel(),
|
||||
) {
|
||||
val state by viewModel.stateFlow.collectAsStateWithLifecycle()
|
||||
EventsEffect(viewModel = viewModel) { event ->
|
||||
|
|
|
@ -17,7 +17,7 @@ import androidx.compose.ui.Modifier
|
|||
import androidx.compose.ui.platform.testTag
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||
import androidx.navigation.NavGraphBuilder
|
||||
|
@ -37,7 +37,7 @@ import kotlinx.parcelize.Parcelize
|
|||
*/
|
||||
@Composable
|
||||
fun VaultUnlockedNavBarScreen(
|
||||
viewModel: VaultUnlockedNavBarViewModel = viewModel(),
|
||||
viewModel: VaultUnlockedNavBarViewModel = hiltViewModel(),
|
||||
navController: NavHostController = rememberNavController(),
|
||||
) {
|
||||
EventsEffect(viewModel = viewModel) { event ->
|
||||
|
|
Loading…
Reference in a new issue