mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-17 21:31:57 +01:00
Fixes: Only close the upload screen if the video upload is a success on the Media tab
This commit is contained in:
parent
617f1ba2a6
commit
d0a9c1ccd0
@ -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 {
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user