()
| 486 | } |
| 487 | |
| 488 | async 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 | |
| 519 | async function loadApp() { |
| 520 | let $mainMenu; |
no test coverage detected