Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
176 changes: 37 additions & 139 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@babel/preset-typescript": "^7.28.5",
"@babel/runtime": "^7.28.4",
"@babel/runtime-corejs3": "^7.28.4",
"@biomejs/biome": "2.1.4",
"@biomejs/biome": "^2.1.4",
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Outdated
"@rspack/cli": "^1.7.0",
"@rspack/core": "^1.7.0",
"@types/ace": "^0.0.52",
Expand All @@ -75,7 +75,7 @@
"com.foxdebug.acode.rk.exec.proot": "file:src/plugins/proot",
"com.foxdebug.acode.rk.exec.terminal": "file:src/plugins/terminal",
"com.foxdebug.acode.rk.plugin.plugincontext": "file:src/plugins/pluginContext",
"cordova-android": "^14.0.1",
"cordova-android": "^15.0.0",
Comment thread
RohitKushvaha01 marked this conversation as resolved.
"cordova-clipboard": "^1.3.0",
"cordova-plugin-advanced-http": "^3.3.1",
"cordova-plugin-browser": "file:src/plugins/browser",
Expand Down
3 changes: 2 additions & 1 deletion src/components/settingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import select from "dialogs/select";
import Ref from "html-tag-js/ref";
import actionStack from "lib/actionStack";
import appSettings from "lib/settings";
import { hideAd } from "lib/startAd";
import FileBrowser from "pages/fileBrowser";
import { isValidColor } from "utils/color/regex";
import helpers from "utils/helpers";
Expand Down Expand Up @@ -99,7 +100,7 @@ export default function settingsPage(
/** DISCLAIMER: do not assign hideSearchBar directly because it can change */
$page.ondisconnect = () => hideSearchBar();
$page.onhide = () => {
helpers.hideAd();
hideAd();
actionStack.remove(title);
};

Expand Down
4 changes: 2 additions & 2 deletions src/lib/removeAds.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import purchaseListener from "handlers/purchase";
import helpers from "utils/helpers";
import { hideAd } from "./startAd.js";
Comment thread
RohitKushvaha01 marked this conversation as resolved.
Comment thread
RohitKushvaha01 marked this conversation as resolved.

/**
* Remove ads after purchase
Expand All @@ -25,7 +25,7 @@ export default function removeAds() {

function onpurchase() {
resolve(null);
helpers.hideAd(true);
hideAd(true);
localStorage.setItem("acode_pro", "true");
window.IS_FREE_VERSION = false;
toast(strings["thank you :)"]);
Expand Down
17 changes: 17 additions & 0 deletions src/lib/startAd.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,20 @@ export default async function startAd() {
window.iad = interstitial;
window.adRewardedUnitId = adUnitIdRewarded;
}

/**
* Hides the ad
* @param {Boolean} [force=false]
*/
export function hideAd(force = false) {
const { ad } = window;
if (ad?.active) {
const $pages = tag.getAll(".page-replacement");
Comment thread
RohitKushvaha01 marked this conversation as resolved.
const hide = $pages.length === 1;

if (force || hide) {
ad.active = false;
ad.hide();
}
}
}
4 changes: 2 additions & 2 deletions src/pages/about/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import Page from "components/page";
import Reactive from "html-tag-js/reactive";
import actionStack from "lib/actionStack";
import constants from "lib/constants";
import { hideAd } from "lib/startAd";
import helpers from "utils/helpers";

export default function AboutInclude() {
const $page = Page(strings.about.capitalize());
const webviewVersionName = Reactive("N/A");
Expand Down Expand Up @@ -115,7 +115,7 @@ export default function AboutInclude() {

$page.onhide = function () {
actionStack.remove("about");
helpers.hideAd();
hideAd();
};

app.append($page);
Expand Down
3 changes: 2 additions & 1 deletion src/pages/adRewards/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import loader from "dialogs/loader";
import actionStack from "lib/actionStack";
import adRewards from "lib/adRewards";
import removeAds from "lib/removeAds";
import { hideAd } from "lib/startAd";
import helpers from "utils/helpers";

let $rewardPage = null;
Expand Down Expand Up @@ -179,7 +180,7 @@ export default function openAdRewardsPage() {
action: $page.hide,
});

helpers.hideAd(true);
hideAd(true);
render();
app.append($page);
$rewardPage = $page;
Expand Down
Loading