# compose


12/12/2021, 2:21 PM
I'm trying to set up the startDestination page based on whether the room database has the specified value, but it keeps getting this error

K Merle

12/12/2021, 2:39 PM
You could do a calculation in splash screen if possible.

Ian Lake

12/12/2021, 4:21 PM
First of all, this isn't how you should be handling login in Navigation, this is something we've covered a couple of times:
Secondly, this isn't how you pass arguments to your start destination: the start destination string needs to match the route string exactly, character by character. You'd use the
on your argument:
But again, you shouldn't need to do that at all
Passing your userId as an argument is generally going to lead you to source of truth issues - Room is your source of truth so your Home screen should be your start destination and collectAsState() on your Room DB to get the current user, conditionally redirecting the user to login if the current userId is null
👍🏻 1