Fixes: Only close the upload screen if the video upload is a success on the Media tab

This commit is contained in:
Vitor Pamplona 2025-01-05 11:22:15 -05:00
parent 617f1ba2a6
commit d0a9c1ccd0
2 changed files with 3 additions and 2 deletions

View File

@ -83,6 +83,7 @@ open class NewMediaModel : ViewModel() {
fun upload(
context: Context,
relayList: List<RelaySetupInfo>,
onSucess: () -> Unit,
onError: (String, String) -> Unit,
) {
viewModelScope.launch {
@ -196,6 +197,7 @@ open class NewMediaModel : ViewModel() {
videoJobs.joinAll()
imageJobs.joinAll()
onSucess()
onceUploaded()
cancelModel()
} else {

View File

@ -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)