Fix types

t3chguy/dedup-icons-17oct
Johannes Marbach 2023-02-04 20:22:03 +01:00
parent 73fdef2174
commit a3d09937d6
2 changed files with 5 additions and 5 deletions

View File

@ -40,12 +40,12 @@ const useMapWithStyle = ({
}: { }: {
id: string; id: string;
centerGeoUri?: string; centerGeoUri?: string;
onError(error: Error): void; onError?(error: Error): void;
interactive?: boolean; interactive?: boolean;
bounds?: Bounds; bounds?: Bounds;
allowGeolocate: boolean; allowGeolocate?: boolean;
}): { }): {
map: maplibregl.Map; map: maplibregl.Map | undefined;
bodyId: string; bodyId: string;
} => { } => {
const bodyId = `mx_Map_${id}`; const bodyId = `mx_Map_${id}`;
@ -122,7 +122,7 @@ const onGeolocateError = (e: GeolocationPositionError): void => {
logger.error("Could not fetch location", e); logger.error("Could not fetch location", e);
Modal.createDialog(ErrorDialog, { Modal.createDialog(ErrorDialog, {
title: _t("Could not fetch location"), title: _t("Could not fetch location"),
description: positionFailureMessage(e.code), description: positionFailureMessage(e.code) ?? "",
}); });
}; };

View File

@ -17,7 +17,7 @@ limitations under the License.
import { _t } from "../../languageHandler"; import { _t } from "../../languageHandler";
import SdkConfig from "../../SdkConfig"; import SdkConfig from "../../SdkConfig";
export const positionFailureMessage = (code: number): string => { export const positionFailureMessage = (code: number): string | undefined => {
const brand = SdkConfig.get().brand; const brand = SdkConfig.get().brand;
switch (code) { switch (code) {
case 1: case 1: