Skip to content

Commit

Permalink
chore: some log
Browse files Browse the repository at this point in the history
  • Loading branch information
dadiorchen committed Feb 11, 2024
1 parent 4f5f40c commit 85af407
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ function MapComponent() {

async function handleClickTree(tree) {
log.warn('click tree:', tree);
window.ReactNativeWebView?.postMessage(JSON.stringify(tree));
if (window.ReactNativeWebView) {
log.debug('react native');
window.ReactNativeWebView?.postMessage(JSON.stringify(tree));
}
if (window.parent) {
log.debug('window.parent');
window.parent.postMessage(JSON.stringify(tree), '*');
}

const wholeTree = await getTreeById(tree.id).catch((err) => log.warn(err));
const result = pathResolver.getPathWhenClickTree(
Expand Down

0 comments on commit 85af407

Please sign in to comment.