Skip to content

Commit

Permalink
Fix Error message after not increasing permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
davigonz committed Aug 6, 2019
1 parent 79fdc02 commit 51f779d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class ShareActivity : FileActivity(), ShareFragmentListener {
}
dismissLoadingDialog()
if (resource.data.isNullOrEmpty()) {
updateSharedWithSharee(false)
updateFileSharedWithSharee(false)
}
}
Status.ERROR -> {
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 51f779d

Please sign in to comment.