MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / promptUpdateCheckConsent

Function promptUpdateCheckConsent

src/main.js:488–517  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

486}
487
488async function promptUpdateCheckConsent() {
489 try {
490 if (isPlayStoreInstall()) {
491 localStorage.setItem("checkForUpdatesPrompted", "true");
492
493 if (settings.value.checkForAppUpdates) {
494 await settings.update({ checkForAppUpdates: false }, false);
495 }
496
497 return;
498 }
499
500 if (Boolean(localStorage.getItem("checkForUpdatesPrompted"))) return;
501
502 if (settings.value.checkForAppUpdates) {
503 localStorage.setItem("checkForUpdatesPrompted", "true");
504 return;
505 }
506
507 const message = strings["prompt update check consent message"];
508 const shouldEnable = await confirm(strings?.confirm, message);
509
510 localStorage.setItem("checkForUpdatesPrompted", "true");
511 if (shouldEnable) {
512 await settings.update({ checkForAppUpdates: true }, false);
513 }
514 } catch (error) {
515 console.error("Failed to prompt for update check consent", error);
516 }
517}
518
519async function loadApp() {
520 let $mainMenu;

Callers 1

onDeviceReadyFunction · 0.85

Calls 4

isPlayStoreInstallFunction · 0.90
confirmFunction · 0.85
updateMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected