fix incorrect window check

This commit is contained in:
Stephan Meijer
2020-04-13 16:01:12 +02:00
parent 8bc331d4bb
commit f395292876

View File

@@ -7,11 +7,13 @@ const viewport: Viewport = {
};
export interface LeafletConfig {
viewport: Viewport;
viewport?: Viewport;
}
const useConfigureLeaflet = (): LeafletConfig => {
if (!window) return;
if (typeof window === 'undefined') {
return {};
}
// To get around an issue with the default icon not being set up right between using React
// and importing the leaflet library, we need to reset the image imports