fix: resolve android plugin registration and electron upload runtime detection regressions

This commit is contained in:
plebeius
2026-02-18 20:13:28 +08:00
parent 4cdbf8c6bc
commit afdf129c3e
4 changed files with 79 additions and 31 deletions
@@ -1,9 +1,13 @@
import { Capacitor } from '@capacitor/core';
import type { UploadMode } from './types';
function isElectronRuntime(): boolean {
return window.electronApi?.isElectron === true || window.isElectron === true;
}
/** Web runtime = web browser, not Electron */
export function isWebRuntime(): boolean {
return Capacitor.getPlatform() === 'web' && !window.electronApi?.isElectron;
return Capacitor.getPlatform() === 'web' && !isElectronRuntime();
}
/**