Something went wrong. Try again.
Local-first knowledge base made for Typst and the Atmosphere. typbase.at
Something went wrong. Try again.
1234567891011121314151617181920212223242526import { isTauri } from "@typbase/storage";
/** * Android hardware back. The webview's history is the app's navigation: back closes the * top overlay or returns to the previous page, and only exits at the root. */export default defineNuxtPlugin(() => { if (!isTauri() || !navigator.userAgent.includes("Android")) return;
void Promise.all([import("@tauri-apps/api/app"), import("@tauri-apps/plugin-process")]) .then(([{ onBackButtonPress }, { exit }]) => onBackButtonPress(({ canGoBack }) => { if (canGoBack) { window.history.back();
return; }
void exit(0); }), ) .catch((cause) => { console.warn("[back] Android listener failed:", cause); });});