diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewMediaModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewMediaModel.kt index 4533f58ec..f818db786 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewMediaModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewMediaModel.kt @@ -83,6 +83,7 @@ open class NewMediaModel : ViewModel() { fun upload( context: Context, relayList: List, + onSucess: () -> Unit, onError: (String, String) -> Unit, ) { viewModelScope.launch { @@ -196,6 +197,7 @@ open class NewMediaModel : ViewModel() { videoJobs.joinAll() imageJobs.joinAll() + onSucess() onceUploaded() cancelModel() } else { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewMediaView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewMediaView.kt index 47f35746c..833417c6e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewMediaView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/NewMediaView.kt @@ -140,8 +140,7 @@ fun NewMediaView( PostButton( onPost = { - onClose() - postViewModel.upload(context, relayList, onError = accountViewModel::toast) + postViewModel.upload(context, relayList, onClose, accountViewModel::toast) postViewModel.selectedServer?.let { if (it.type != ServerType.NIP95) { account.settings.changeDefaultFileServer(it)