mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Fix bug maintenance mode in share view
This commit is contained in:
parent
f38e0e12a0
commit
412ce69fcb
2 changed files with 18 additions and 9 deletions
|
@ -265,15 +265,19 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
|
|||
// The Toast must be shown in the main thread to grant that will be hidden correctly; otherwise
|
||||
// the thread may die before, an exception will occur, and the message will be left on the screen
|
||||
// until the app dies
|
||||
Toast.makeText(
|
||||
getContext().getApplicationContext(),
|
||||
ErrorMessageAdapter.getErrorCauseMessage(
|
||||
result,
|
||||
null,
|
||||
getContext().getResources()
|
||||
),
|
||||
Toast.LENGTH_SHORT
|
||||
).show();
|
||||
|
||||
// Edited: this toast message has no sense. If operation is being passed as null to getErrorCauseMessage(),
|
||||
// the returned message is always null and therefore an empty toast is shown. Pending to review and change/delete
|
||||
|
||||
// Toast.makeText(
|
||||
// getContext().getApplicationContext(),
|
||||
// ErrorMessageAdapter.getErrorCauseMessage(
|
||||
// result,
|
||||
// null,
|
||||
// getContext().getResources()
|
||||
// ),
|
||||
// Toast.LENGTH_SHORT
|
||||
// ).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import com.owncloud.android.operations.CreateFolderOperation;
|
|||
import com.owncloud.android.operations.CreateShareViaLinkOperation;
|
||||
import com.owncloud.android.operations.CreateShareWithShareeOperation;
|
||||
import com.owncloud.android.operations.DownloadFileOperation;
|
||||
import com.owncloud.android.operations.GetSharesForFileOperation;
|
||||
import com.owncloud.android.operations.MoveFileOperation;
|
||||
import com.owncloud.android.operations.RemoveFileOperation;
|
||||
import com.owncloud.android.operations.RenameFileOperation;
|
||||
|
@ -309,6 +310,10 @@ public class ErrorMessageAdapter {
|
|||
// Show a Message, operation finished without success
|
||||
message = res.getString(R.string.copy_file_error);
|
||||
}
|
||||
} else if (operation instanceof GetSharesForFileOperation) {
|
||||
if (result.getCode() == ResultCode.MAINTENANCE_MODE) {
|
||||
message = res.getString(R.string.maintenance_mode);
|
||||
}
|
||||
}
|
||||
|
||||
return message;
|
||||
|
|
Loading…
Reference in a new issue