docs(email-composer): update example (#4101)

"this.emailComposer.hasClient()" and "this.emailComposer.isAvailable()" method usage is wrong on the official documentation. Please check.
.hasClient and .isAvailable both requires an app name string as the parameter, and they return promises. 
The original code of putting the parameter "app" into the "then()" chainable is not correct, as the "then()" only accepts callback functions as parameters.
Tested and proved in visual studio code.
This commit is contained in:
glv1at118 2022-04-02 13:31:46 -04:00 committed by GitHub
parent 32c65efe10
commit 07093dc553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,7 @@ export interface EmailComposerOptions {
* // Returns an array of configured email clients for the device
* });
*
* this.emailComposer.hasClient().then(app, (isValid: boolean) => {
* this.emailComposer.hasClient(app).then((isValid: boolean) => {
* if (isValid) {
* // Now we know we have a valid email client configured
* // Not specifying an app will return true if at least one email client is configured
@ -80,7 +80,7 @@ export interface EmailComposerOptions {
* }
* });
*
* this.emailComposer.isAvailable().then(app, (available: boolean) => {
* this.emailComposer.isAvailable(app).then((available: boolean) => {
* if(available) {
* // Now we know we can send an email, calls hasClient and hasAccount
* // Not specifying an app will return true if at least one email client is configured