Add iOS & Android build + frontend fixes for desktop
Build & Push Docker Images / test-backend (push) Successful in 53s
Build & Push Docker Images / test-frontend (push) Successful in 58s
Build & Push Docker Images / build-backend (push) Successful in 1m4s
Build & Push Docker Images / build-frontend (push) Failing after 56s
Build & Push Docker Images / test-backend (push) Successful in 53s
Build & Push Docker Images / test-frontend (push) Successful in 58s
Build & Push Docker Images / build-backend (push) Successful in 1m4s
Build & Push Docker Images / build-frontend (push) Failing after 56s
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// Capacitor bootstrap — no-ops on the web, configures native shell on mobile.
|
||||
// Plugins are dynamic-imported so the web bundle isn't penalized.
|
||||
|
||||
let initStarted = false;
|
||||
|
||||
export function isNativeApp() {
|
||||
return typeof window !== 'undefined' && Boolean(window.Capacitor?.isNativePlatform?.());
|
||||
}
|
||||
|
||||
export async function initNativeShell() {
|
||||
if (initStarted || !isNativeApp()) return;
|
||||
initStarted = true;
|
||||
|
||||
try {
|
||||
const { StatusBar, Style } = await import('@capacitor/status-bar');
|
||||
await StatusBar.setBackgroundColor({ color: '#0f766e' }).catch(() => {});
|
||||
await StatusBar.setStyle({ style: Style.Light }).catch(() => {});
|
||||
} catch {
|
||||
/* plugin not present — fine on web */
|
||||
}
|
||||
|
||||
try {
|
||||
const { SplashScreen } = await import('@capacitor/splash-screen');
|
||||
await SplashScreen.hide({ fadeOutDuration: 250 }).catch(() => {});
|
||||
} catch {
|
||||
/* plugin not present — fine on web */
|
||||
}
|
||||
|
||||
try {
|
||||
const { App } = await import('@capacitor/app');
|
||||
App.addListener('backButton', ({ canGoBack }) => {
|
||||
if (canGoBack) window.history.back();
|
||||
else App.exitApp();
|
||||
});
|
||||
} catch {
|
||||
/* plugin not present — fine on web */
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user