cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thehuijb <...@git.apache.org>
Subject [GitHub] cordova-plugin-camera pull request: CB-8804 implement check for sa...
Date Mon, 22 Jun 2015 10:35:32 GMT
Github user thehuijb commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-camera/pull/97#discussion_r32921498
  
    --- Diff: src/android/CameraLauncher.java ---
    @@ -163,7 +159,19 @@ else if ((srcType == PHOTOLIBRARY) || (srcType == SAVEDPHOTOALBUM))
{
                 PluginResult r = new PluginResult(PluginResult.Status.NO_RESULT);
                 r.setKeepCallback(true);
                 callbackContext.sendPluginResult(r);
    -            
    +
    +            return true;
    +        } else if (action.equals("checkForSavedResult")) {
    +            if (savedRequestCode > 0 || savedResultCode > 0) {
    +                processConfiguration(args);
    +                imageUri = Uri.fromFile(createCaptureFile(encodingType));
    +                onActivityResult(savedRequestCode, savedResultCode, savedIntent);
    +                savedRequestCode = 0;
    +                savedResultCode = 0;
    +                savedIntent = null;
    +            } else {
    +                callbackContext.success("");
    --- End diff --
    
    one should only return an error when an error occurs.
    @agrieve advised me to callback success with empty string so you can handle the result
in onSuccess javascript like so:
    `if (result) {
      //do something
    }`
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message