Skip to content

fix: syntax error#2096

Merged
RohitKushvaha01 merged 1 commit into
Acode-Foundation:ajit/fix-fetch-auth-configfrom
RohitKushvaha01:ajit/fix-fetch-auth-config
May 10, 2026
Merged

fix: syntax error#2096
RohitKushvaha01 merged 1 commit into
Acode-Foundation:ajit/fix-fetch-auth-configfrom
RohitKushvaha01:ajit/fix-fetch-auth-config

Conversation

@RohitKushvaha01
Copy link
Copy Markdown
Member

No description provided.

@RohitKushvaha01 RohitKushvaha01 merged commit 01dfe2a into Acode-Foundation:ajit/fix-fetch-auth-config May 10, 2026
4 of 5 checks passed
@RohitKushvaha01 RohitKushvaha01 deleted the ajit/fix-fetch-auth-config branch May 10, 2026 13:44
@RohitKushvaha01 RohitKushvaha01 restored the ajit/fix-fetch-auth-config branch May 10, 2026 13:44
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 10, 2026

Greptile Summary

This PR replaces the system.getInstaller(success, error) call in config.js with an equivalent direct cordova.exec(success, error, 'System', 'getInstaller', []) call to resolve a reference error on the base branch where system was not in scope.

  • The functional behavior is unchanged: config.IAP_AVAILABLE is still set via the same native Cordova action (System/getInstaller), with an identical success and error handler.
  • The change bypasses the system Cordova plugin wrapper (defined in src/plugins/system/www/plugin.js) in favour of hardcoded service/action strings, making the call harder to trace back to the plugin.
  • The success callback body retains two-tab indentation from the prior layout, leaving it over-indented by one level relative to the new cordova.exec( call site.

Confidence Score: 4/5

Safe 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 system plugin wrapper). No logic, data flow, or error handling was altered.

src/lib/config.js — worth a second look on the indentation and the direct cordova.exec call vs the plugin wrapper.

Important Files Changed

Filename Overview
src/lib/config.js Replaces system.getInstaller() wrapper with a direct cordova.exec() call — functionally equivalent but bypasses the plugin abstraction and introduces inconsistent indentation in the callback body.

Reviews (1): Last reviewed commit: "fix: syntax error" | Re-trigger Greptile

Comment thread src/lib/config.js
Comment on lines 55 to +65
@@ -62,7 +62,6 @@ system.getInstaller(
(error) => {
console.error(error);
config.IAP_AVAILABLE = typeof iap !== "undefined";
},
);
}, 'System', 'getInstaller', []);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
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!

Comment thread src/lib/config.js
Comment on lines 55 to +65
@@ -62,7 +62,6 @@ system.getInstaller(
(error) => {
console.error(error);
config.IAP_AVAILABLE = typeof iap !== "undefined";
},
);
}, 'System', 'getInstaller', []);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

deadlyjack added a commit that referenced this pull request May 11, 2026
* Refactor API calls to use fetch instead of ajax and update configuration imports

- Replaced ajax calls with fetch in sponsor, sponsors, and themeSetting pages.
- Updated constants import to config in various files for better configuration management.
- Improved error handling for API responses.
- Adjusted logic for premium theme checks based on new config settings.
- Enhanced cookie management in the Authenticator plugin for better security.
- Fixed minor typos and improved code readability across multiple files.

* fix: update BASE_URL to production and enhance plugin loading feedback

* fix: update cookie settings to include HttpOnly for enhanced security

* fix: hooks not working on free version (#2075)

* fix: hooks not working on free version

* Update hooks/post-process.js

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update post-process.js

---------

* fix: JSON formatting for UI zoom setting description

* fix: JSON formatting and update translations

* fix: JSON formatting and update translations

* feat: IAP_AVAILABLE (#2086)

* feat: IAP_AVAILABLE

* fix: removed useless logs

* feat: added web redirect (#2087)

* feat: added web redirect

* fix: removed useless code

* fix: removed useless code

* fix: added try/catch

* fix: check owned before launching webpage

* feat: added api to get installer package

* feat: added installer check

* format

* fix: undefined error

* Update src/lib/config.js

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix: syntax error (#2096)

* Refactor plugin installation and purchase handling

- Enhanced HandleIntent function to validate plugin installation requests.
- Modified getLoggedInUser method to return a Promise.
- Removed IAP_AVAILABLE from config and adjusted related logic.
- Improved main.js to handle app installation source and define appInstallSource.
- Refactored plugin page to streamline plugin installation and purchase logic.
- Added external purchase handling in plugin view and buttons.
- Updated IAP plugin to track availability status.
- Enhanced ListItem component to manage plugin installation and purchase flow.
- Introduced shouldAllowExternalPurchase helper function for better purchase logic.

* fix: update Android version and improve XML formatting

* feat: add login prompt for viewing owned plugins and update language files

* fix: formatting

* fix

---------

Co-authored-by: Ajit Kumar <dellevenjack@gmail>
Co-authored-by: Rohit Kushvaha <oldisg131@gmail.com>
Co-authored-by: Emmanuel Lobo <76094069+UnschooledGamer@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Raunak Raj <71929976+bajrangCoder@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant