Something went wrong. Try again.
An Android app for exploring the marine life, featuring local names, detailed profiles, and easy search. One-stop-shop for researchers, hob…
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334import './assets/main.css';
import { createApp } from 'vue';import App from './App.vue';import router from './router';import { App as CapApp } from '@capacitor/app'; // Import Capacitor App pluginimport 'flowbite';
const app = createApp(App);
app.use(router);
app.mount('#app');
let firstPressDetected = false;let pressTimer = null;
// Mobile: Handle back button press with CapacitorCapApp.addListener('backButton', ({ canGoBack }) => { if (firstPressDetected) { console.log("Second back button press detected. Simulated exit."); CapApp.exitApp() firstPressDetected = false; // Reset the flag after the second press } else { console.log("First back button press detected."); router.push('/home'); // Navigate to the home route
firstPressDetected = true; // Set flag for the first press pressTimer = setTimeout(() => { firstPressDetected = false; // Reset the flag after 1 second }, 1000); }});