fix: syntax error#2096
fix: syntax error#2096RohitKushvaha01 merged 1 commit intoAcode-Foundation:ajit/fix-fetch-auth-configfrom
Conversation
01dfe2a
into
Acode-Foundation:ajit/fix-fetch-auth-config
Greptile SummaryThis PR replaces the
Confidence Score: 4/5Safe to merge — the change is functionally identical to the code it replaces. The only differences from the original are cosmetic (indentation) and a loss of abstraction (hardcoded Cordova service/action strings instead of the src/lib/config.js — worth a second look on the indentation and the direct Important Files Changed
Reviews (1): Last reviewed commit: "fix: syntax error" | Re-trigger Greptile |
| @@ -62,7 +62,6 @@ system.getInstaller( | |||
| (error) => { | |||
| console.error(error); | |||
| config.IAP_AVAILABLE = typeof iap !== "undefined"; | |||
| }, | |||
| ); | |||
| }, 'System', 'getInstaller', []); | |||
There was a problem hiding this comment.
The success callback body is still indented at two tabs relative to the root level (a remnant of the prior
system.getInstaller layout where the arrow function started on its own indented line). Now that the arrow function opens inline with cordova.exec(, the body and closing brace are over-indented by one level compared to convention.
| cordova.exec( | |
| (installer) => { | |
| config.IAP_AVAILABLE = | |
| typeof iap !== "undefined" && | |
| installer != null && | |
| installer !== "null" && | |
| installer === "com.android.vending"; | |
| }, | |
| (error) => { | |
| console.error(error); | |
| config.IAP_AVAILABLE = typeof iap !== "undefined"; | |
| }, | |
| 'System', 'getInstaller', []); |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| @@ -62,7 +62,6 @@ system.getInstaller( | |||
| (error) => { | |||
| console.error(error); | |||
| config.IAP_AVAILABLE = typeof iap !== "undefined"; | |||
| }, | |||
| ); | |||
| }, 'System', 'getInstaller', []); | |||
There was a problem hiding this comment.
Direct
cordova.exec call bypasses the plugin abstraction
system.getInstaller (defined in src/plugins/system/www/plugin.js) was the canonical entry point for this operation. Replacing it with hardcoded cordova.exec(..., 'System', 'getInstaller', []) strings means any future rename of the service or action in the plugin won't be caught here automatically. Prefer calling system.getInstaller(success, error) if the reason the original call was removed is resolved, or leave a comment explaining why the direct call is necessary.
No description provided.