Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/lib/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const BASE_URL = "https://acode.app";

Check failure on line 1 in src/lib/config.js

View workflow job for this annotation

GitHub Actions / Linting and formatting

format

File content differs from formatting output
let hasPro = false;

const config = {
Expand Down Expand Up @@ -51,8 +51,8 @@
},
};

system.getInstaller(
(installer) => {

cordova.exec((installer) => {
config.IAP_AVAILABLE =
typeof iap !== "undefined" &&
installer != null &&
Expand All @@ -62,7 +62,6 @@
(error) => {
console.error(error);
config.IAP_AVAILABLE = typeof iap !== "undefined";
},
);
}, 'System', 'getInstaller', []);
Comment on lines 55 to +65
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 on lines 55 to +65
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.


export default config;
Loading