mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-08-08 20:42:19 +02:00
Fixes: Only close the upload screen if the video upload is a success on the Media tab
This commit is contained in:
@@ -83,6 +83,7 @@ open class NewMediaModel : ViewModel() {
|
|||||||
fun upload(
|
fun upload(
|
||||||
context: Context,
|
context: Context,
|
||||||
relayList: List<RelaySetupInfo>,
|
relayList: List<RelaySetupInfo>,
|
||||||
|
onSucess: () -> Unit,
|
||||||
onError: (String, String) -> Unit,
|
onError: (String, String) -> Unit,
|
||||||
) {
|
) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@@ -196,6 +197,7 @@ open class NewMediaModel : ViewModel() {
|
|||||||
videoJobs.joinAll()
|
videoJobs.joinAll()
|
||||||
imageJobs.joinAll()
|
imageJobs.joinAll()
|
||||||
|
|
||||||
|
onSucess()
|
||||||
onceUploaded()
|
onceUploaded()
|
||||||
cancelModel()
|
cancelModel()
|
||||||
} else {
|
} else {
|
||||||
|
@@ -140,8 +140,7 @@ fun NewMediaView(
|
|||||||
|
|
||||||
PostButton(
|
PostButton(
|
||||||
onPost = {
|
onPost = {
|
||||||
onClose()
|
postViewModel.upload(context, relayList, onClose, accountViewModel::toast)
|
||||||
postViewModel.upload(context, relayList, onError = accountViewModel::toast)
|
|
||||||
postViewModel.selectedServer?.let {
|
postViewModel.selectedServer?.let {
|
||||||
if (it.type != ServerType.NIP95) {
|
if (it.type != ServerType.NIP95) {
|
||||||
account.settings.changeDefaultFileServer(it)
|
account.settings.changeDefaultFileServer(it)
|
||||||
|
Reference in New Issue
Block a user