1.0.70
All checks were successful
Build and Release / build-and-release (push) Successful in 17m57s

This commit is contained in:
Bryan1029384756
2026-04-14 20:59:21 -05:00
parent 965048f7d2
commit f2dc627b76
11 changed files with 577 additions and 33 deletions

View File

@@ -53,9 +53,18 @@ const webPlatform = {
// Detect Android/Capacitor and enable native APK updates
if (window.Capacitor?.isNativePlatform?.()) {
const YAML_URL = 'https://gitea.moyettes.com/Moyettes/DiscordClone/releases/download/latest/latest-android.yml';
const AppUpdater = window.Capacitor.Plugins.AppUpdater;
// MainActivity.java's `registerPlugin(AppUpdaterPlugin.class)` puts this
// on `window.Capacitor.Plugins.AppUpdater` at runtime. Guard against
// the plugin being absent in case a future build forgets to register
// it — the whole updater surface then no-ops instead of NPE-ing on
// first invocation.
const AppUpdater = window.Capacitor?.Plugins?.AppUpdater;
let apkUrl;
if (!AppUpdater) {
console.warn('[UpdateCheck] AppUpdater plugin not found — updates disabled');
}
webPlatform.updates = {
async checkUpdate() {
try {