Fix exception in app

This commit is contained in:
redphx
2024-12-09 18:18:40 +07:00
parent d0b84d4591
commit f0e4d4b8d0
4 changed files with 32 additions and 15 deletions

View File

@@ -120,11 +120,15 @@ export class BxEventBus<TEvents extends Record<string, any>> {
// Call method inside Android app
if (AppInterface) {
if (event in this.appJsInterfaces) {
const method = this.appJsInterfaces[event];
AppInterface[method] && AppInterface[method]();
} else {
AppInterface.onEventBus(this.group + '.' + (event as string));
try {
if (event in this.appJsInterfaces) {
const method = this.appJsInterfaces[event];
AppInterface[method] && AppInterface[method]();
} else {
AppInterface.onEventBus(this.group + '.' + (event as string));
}
} catch (e) {
console.log(e);
}
}