Skip to content

Commit

Permalink
image fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
sknr15 committed Oct 24, 2022
1 parent 781aafb commit 96f4694
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const App = () => {
const [map, setMap] = useState<TMap>({
key: 'mapexample',
title: 'Map Example',
imageSource: example,
imageSource: example ?? { uri: 'https://www.edrawsoft.com/images/examples/office%20position.png' },
positions: [...pos]
});

Expand Down
4 changes: 3 additions & 1 deletion src/Map/MapPicker/MapPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export const MapPicker = ({ map, onChange, testId }: Props) => {
let _src = require('../../Assets/mapExample2.png');

if (tempMap?.imageSource === _src) {
_src = require('../../Assets/mapExample.png');
_src = require('../../Assets/mapExample.png') ?? {
uri: 'https://www.edrawsoft.com/images/examples/office%20position.png'
};
}

setTempMap({ ...tempMap, imageSource: _src, positions: [] });
Expand Down

0 comments on commit 96f4694

Please sign in to comment.