diff --git a/owncloudApp/src/main/java/com/owncloud/android/shares/presentation/ShareActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/shares/presentation/ShareActivity.kt index d609ec56fec..e11983ccc00 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/shares/presentation/ShareActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/shares/presentation/ShareActivity.kt @@ -219,7 +219,7 @@ class ShareActivity : FileActivity(), ShareFragmentListener { } dismissLoadingDialog() if (resource.data.isNullOrEmpty()) { - updateSharedWithSharee(false) + updateFileSharedWithSharee(false) } } Status.ERROR -> { @@ -295,7 +295,7 @@ class ShareActivity : FileActivity(), ShareFragmentListener { Observer { resource -> when (resource?.status) { Status.SUCCESS -> { - updateSharedWithSharee(true) + updateFileSharedWithSharee(true) } Status.ERROR -> { val errorMessage = resource.msg ?: ErrorMessageAdapter.getResultMessage( @@ -375,7 +375,7 @@ class ShareActivity : FileActivity(), ShareFragmentListener { Observer { resource -> when (resource?.status) { Status.SUCCESS -> { - updateSharedWithSharee(true) + updateFileSharedWithSharee(true) } Status.ERROR -> { val errorMessage: String = resource.msg ?: ErrorMessageAdapter.getResultMessage( @@ -403,7 +403,7 @@ class ShareActivity : FileActivity(), ShareFragmentListener { fileOperationsHelper.copyOrSendPrivateLink(file) } - private fun updateSharedWithSharee(isSharedWithSharee: Boolean) { + private fun updateFileSharedWithSharee(isSharedWithSharee: Boolean) { storageManager.getFileByPath(file.remotePath)?.let { file -> file.isSharedWithSharee = isSharedWithSharee storageManager.saveFile(file) diff --git a/owncloudApp/src/main/java/com/owncloud/android/shares/presentation/fragment/EditPrivateShareFragment.kt b/owncloudApp/src/main/java/com/owncloud/android/shares/presentation/fragment/EditPrivateShareFragment.kt index 72310fa7a6c..d791b730545 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/shares/presentation/fragment/EditPrivateShareFragment.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/shares/presentation/fragment/EditPrivateShareFragment.kt @@ -31,6 +31,7 @@ import android.view.ViewGroup import android.widget.CheckBox import android.widget.CompoundButton import androidx.appcompat.widget.SwitchCompat +import androidx.core.view.isGone import androidx.fragment.app.DialogFragment import com.owncloud.android.R import com.owncloud.android.authentication.AccountUtils @@ -386,6 +387,8 @@ class EditPrivateShareFragment : DialogFragment() { * Updates the permissions of the [RemoteShare] according to the values set in the UI */ private fun updatePermissionsToShare() { + private_share_error_message?.isGone = true + val spb = SharePermissionsBuilder() spb.setSharePermission(canShareSwitch.isChecked) if (file?.isFolder == true) {