@@ -84,7 +84,7 @@ sealed class MainNavigation(override val matomoValue: String) : NavigationDestin
84
84
private const val sentDestinationName = " SentDestination"
85
85
private const val receivedDestinationName = " ReceivedDestination"
86
86
private const val settingsDestinationName = " SettingsDestination"
87
- val destinationsNames = listOf (
87
+ val mainDestinationsNames = listOf (
88
88
sentDestinationName,
89
89
receivedDestinationName,
90
90
settingsDestinationName,
@@ -93,10 +93,10 @@ sealed class MainNavigation(override val matomoValue: String) : NavigationDestin
93
93
fun NavBackStackEntry.toMainDestination (): MainNavigation ? {
94
94
return runCatching {
95
95
val destinationRoute = destination.route ? : error(" Destination route cannot be empty" )
96
- when (destinationsNames .firstOrNull { destinationRoute.contains(it) }) {
97
- sentDestinationName -> this . toRoute<SentDestination >()
98
- receivedDestinationName -> this . toRoute<ReceivedDestination >()
99
- settingsDestinationName -> this . toRoute<SettingsDestination >()
96
+ when (mainDestinationsNames .firstOrNull { destinationRoute.contains(it) }) {
97
+ sentDestinationName -> toRoute<SentDestination >()
98
+ receivedDestinationName -> toRoute<ReceivedDestination >()
99
+ settingsDestinationName -> toRoute<SettingsDestination >()
100
100
else -> error(" Destination $destinationRoute is not handled" )
101
101
}
102
102
}.getOrElse { exception ->
@@ -152,33 +152,33 @@ sealed class NewTransferNavigation(override val matomoValue: String) : Navigatio
152
152
private val TAG = NewTransferNavigation ::class .java.simpleName
153
153
154
154
private const val importFilesDestinationName = " ImportFilesDestination"
155
- private const val ValidateUserEmailDestinationName = " ValidateUserEmailDestination"
156
- private const val UploadProgressDestinationName = " UploadProgressDestination"
157
- private const val UploadSuccessDestinationName = " UploadSuccessDestination"
158
- private const val UploadErrorDestinationName = " UploadErrorDestination"
159
- private const val UploadIntegrityErrorDestinationName = " UploadIntegrityErrorDestination"
160
- private const val NewTransferFilesDetailsDestinationName = " NewTransferFilesDetailsDestination"
155
+ private const val validateUserEmailDestinationName = " ValidateUserEmailDestination"
156
+ private const val uploadProgressDestinationName = " UploadProgressDestination"
157
+ private const val uploadSuccessDestinationName = " UploadSuccessDestination"
158
+ private const val uploadErrorDestinationName = " UploadErrorDestination"
159
+ private const val uploadIntegrityErrorDestinationName = " UploadIntegrityErrorDestination"
160
+ private const val newTransferFilesDetailsDestinationName = " NewTransferFilesDetailsDestination"
161
161
val newTransferDestinationsNames = listOf (
162
162
importFilesDestinationName,
163
- ValidateUserEmailDestinationName ,
164
- UploadProgressDestinationName ,
165
- UploadSuccessDestinationName ,
166
- UploadErrorDestinationName ,
167
- UploadIntegrityErrorDestinationName ,
168
- NewTransferFilesDetailsDestinationName ,
163
+ validateUserEmailDestinationName ,
164
+ uploadProgressDestinationName ,
165
+ uploadSuccessDestinationName ,
166
+ uploadErrorDestinationName ,
167
+ uploadIntegrityErrorDestinationName ,
168
+ newTransferFilesDetailsDestinationName ,
169
169
)
170
170
171
171
fun NavBackStackEntry.toNewTransferDestination (): NewTransferNavigation ? {
172
172
return runCatching {
173
173
val destinationRoute = destination.route ? : error(" Destination route cannot be empty" )
174
174
when (newTransferDestinationsNames.firstOrNull(destinationRoute::contains)) {
175
- importFilesDestinationName -> this . toRoute<ImportFilesDestination >()
176
- ValidateUserEmailDestinationName -> this . toRoute<ValidateUserEmailDestination >()
177
- UploadProgressDestinationName -> this . toRoute<UploadProgressDestination >()
178
- UploadSuccessDestinationName -> this . toRoute<UploadSuccessDestination >()
179
- UploadErrorDestinationName -> this . toRoute<UploadErrorDestination >()
180
- UploadIntegrityErrorDestinationName -> this . toRoute<UploadIntegrityErrorDestination >()
181
- NewTransferFilesDetailsDestinationName -> this . toRoute<NewTransferFilesDetailsDestination >()
175
+ importFilesDestinationName -> toRoute<ImportFilesDestination >()
176
+ validateUserEmailDestinationName -> toRoute<ValidateUserEmailDestination >()
177
+ uploadProgressDestinationName -> toRoute<UploadProgressDestination >()
178
+ uploadSuccessDestinationName -> toRoute<UploadSuccessDestination >()
179
+ uploadErrorDestinationName -> toRoute<UploadErrorDestination >()
180
+ uploadIntegrityErrorDestinationName -> toRoute<UploadIntegrityErrorDestination >()
181
+ newTransferFilesDetailsDestinationName -> toRoute<NewTransferFilesDetailsDestination >()
182
182
else -> error(" Destination $destinationRoute is not handled" )
183
183
}
184
184
}.getOrElse { exception ->
0 commit comments