Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
emitter.on("fit-bounds", this._fitBounds);
// emitter.on("fit-marker", this._fitMarker);
// emitter.on("reset-marker", this._resetMarker);
}
this.props.fetch({
id
});
}
this._loadingTimeout = setTimeout(() => {
this.setState({
loading: false
});
}, 150);
// if (IOS) {
// StatusBar.setBarStyle("light-content");
// }
emitter.on(InfoScreen.mapId, this._showLocation);
}
useEffect(() => {
const dismissFilters = () => {
emitter.emit("filters");
};
const onEvent = () => {
if (IOS) {
initialLoadCompleted.current = false;
requestAnimationFrame(dismissFilters);
} else if (ANDROID) {
requestAnimationFrame(dismissFilters);
} else if (WEB) {
requestAnimationFrame(dismissFilters);
}
};
emitter.on("refresh", onEvent);
return () => {
emitter.off("refresh", onEvent);
};
}, []);
componentDidMount() {
emitter.on("preview-bounds", this._previewBounds);
emitter.on("reset-bounds-preview", this._resetRegion);
const show = IOS ? "keyboardWillShow" : "keyboardDidShow";
this.keyboardWillShowListener = Keyboard.addListener(
show,
this._keyboardWillShow
);
if (ANDROID) {
const hide = IOS ? "keyboardWillHide" : "keyboardDidHide";
this.keyboardWillHideListener = Keyboard.addListener(
hide,
this._keyboardWillHide
);
}
}
componentDidMount() {
emitter.on("toggle-menu", this._toggleMenu);
emitter.on("toggle-search", this._toggleSearch);
emitter.on("info-pop", this._onInfoPop);
if (ANDROID) {
this.keyboardWillHideListener = Keyboard.addListener(
"keyboardDidHide",
this._keyboardWillHide
);
}
}
e.preventDefault();
};
const onFocus = () => {
inputRef.current.focus();
if (WEB) {
window.addEventListener("mousedown", onMouseDown);
}
};
const onBlur = () => {
inputRef.current.blur();
if (WEB) {
window.removeEventListener("mousedown", onMouseDown);
}
};
emitter.on("focus-interested", onFocus);
emitter.on("blur-interested", onBlur);
return () => {
emitter.off("focus-interested", onFocus);
emitter.off("blur-interested", onBlur);
};
}, []);
componentDidMount() {
BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
AppState.addEventListener('change', this.handleAppStateChange);
tracker.trackScreenView('Map');
emitter.on(GFWOnHeadingEvent, this.updateHeading);
emitter.on(GFWOnLocationEvent, this.updateLocationFromGeolocation);
this.geoLocate();
this.staleLocationTimer = setInterval(() => {
this.setState(state => {
if (
!state.locationError &&
state.location &&
Date.now() - state.location.timestamp > STALE_LOCATION_THRESHOLD
) {
return {
locationError: GFWErrorLocationStale
};
}
return {};
});
componentDidMount() {
emitter.on("preview-bounds", this._previewBounds);
emitter.on("reset-bounds-preview", this._resetRegion);
const show = IOS ? "keyboardWillShow" : "keyboardDidShow";
this.keyboardWillShowListener = Keyboard.addListener(
show,
this._keyboardWillShow
);
if (ANDROID) {
const hide = IOS ? "keyboardWillHide" : "keyboardDidHide";
this.keyboardWillHideListener = Keyboard.addListener(
hide,
this._keyboardWillHide
);
}
}
componentDidMount() {
emitter.on("calendar-top", this._scrollToTop);
if (IOS) {
emitter.on("reclip-calendar", this._reclip);
}
}
componentDidMount() {
emitter.on("fit-marker", this._fitMarker);
emitter.on("hide-callouts", this._hideCallout);
}