Merge branch 'claude/admiring-mahavira-a862d1' into artifacts
# Conflicts: # composeApp/src/commonMain/kotlin/press/mantra/compose/ui/view/model/AddArtifactViewModel.kt
This commit is contained in:
@@ -60,6 +60,7 @@ import press.mantra.compose.ui.theme.TorchTheme
|
||||
import press.mantra.compose.ui.view.state.ChatRoomMessagingUIState
|
||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||
import press.mantra.compose.repository.MantraRepository
|
||||
import press.mantra.compose.ui.composable.navigation.routes.ArtifactDetailRoute
|
||||
import press.mantra.compose.ui.composable.navigation.routes.ImplementationPendingRoute
|
||||
import press.mantra.compose.ui.view.model.AddArtifactViewModel
|
||||
import press.mantra.compose.ui.view.state.AddArtifactUIState
|
||||
@@ -141,9 +142,16 @@ fun AddArtifactScreen(
|
||||
dialectNameField = dialectNameFieldState,
|
||||
dialectCountryField = dialectCountryFieldState,
|
||||
dialectLanguageField = dialectLanguageFieldState,
|
||||
onSuccess = {
|
||||
onNavigateToRoute.invoke(
|
||||
ImplementationPendingRoute("Add Artifact")
|
||||
onSuccess = { artifactId ->
|
||||
// Open the newly created artifact, removing this
|
||||
// add screen from the back stack.
|
||||
onNavigateToRouteAndPopUpInclusive.invoke(
|
||||
ArtifactDetailRoute(
|
||||
activeUserPublicKey = activeUserPublicKey,
|
||||
artifactId = artifactId,
|
||||
chatRoomId = chatRoomId,
|
||||
relayHint = relayHint
|
||||
)
|
||||
)
|
||||
},
|
||||
onFailure = {
|
||||
|
||||
@@ -69,7 +69,7 @@ class AddArtifactViewModel(
|
||||
dialectLanguageField: TextFieldState,
|
||||
visibility: String = MantraRepository.DEFAULT_VISIBILITY,
|
||||
license: String = MantraRepository.DEFAULT_LICENSE,
|
||||
onSuccess: () -> Unit,
|
||||
onSuccess: (artifactId: String) -> Unit,
|
||||
onFailure: () -> Unit
|
||||
) {
|
||||
val name = nameField.text.toString()
|
||||
@@ -132,7 +132,7 @@ class AddArtifactViewModel(
|
||||
dialectLanguageField.clearText()
|
||||
|
||||
viewModelScope.launch(Dispatchers.Main) {
|
||||
onSuccess.invoke()
|
||||
onSuccess.invoke(marmotInnerEvent.id)
|
||||
}
|
||||
} else {
|
||||
viewModelScope.launch(Dispatchers.Main) {
|
||||
|
||||
Reference in New Issue
Block a user