modal-navigation
Version:
CapacitorJS plugin to handle modal navigation and back button behavior.
20 lines (19 loc) • 542 B
JavaScript
import { WebPlugin } from '@capacitor/core';
export class ModalNavigationWeb extends WebPlugin {
constructor() {
super(...arguments);
this.modalOpen = false;
}
isModalOpen() {
return Promise.resolve({ open: this.modalOpen });
}
closeModal() {
this.modalOpen = false;
// Implement logic to close modal in your web app if needed
return Promise.resolve();
}
// For demo/testing: allow setting modal state
setModalOpen(open) {
this.modalOpen = open;
}
}