Avoid sharing the QR code image if the fields are not filled correctly

This commit is contained in:
Severiano Jaramillo 2018-12-21 18:24:39 -06:00
parent 5240e88e1f
commit 80b5f9f571

View file

@ -382,6 +382,11 @@ class ReceiveTransactionFragment : Fragment(), ServiceConnection {
* sends an intent so the user can select the desired method to share the image. * sends an intent so the user can select the desired method to share the image.
*/ */
private fun shareQRScreenshot() { private fun shareQRScreenshot() {
// TODO improve, show errors where necessary so the user can fix it
// Avoid sharing the QR code image if the fields are not filled correctly
if (mAsset == null)
return
// Get Screenshot // Get Screenshot
val screenshot = Helper.loadBitmapFromView(container) val screenshot = Helper.loadBitmapFromView(container)
val imageUri = Helper.saveTemporalBitmap(context!!, screenshot) val imageUri = Helper.saveTemporalBitmap(context!!, screenshot)