Skip to content

Commit

Permalink
[fix] 🪄 Hotfix publishedArea Logic issue ("[]")
Browse files Browse the repository at this point in the history
  • Loading branch information
steward379 committed Mar 25, 2024
1 parent 02bae79 commit b4e4366
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/PublishArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const PublishArea = ({ publishedPlaces, onAddToPublish = undefined, onRemoveFrom
<div ref={drop} className="mt-5 p-2 border border-gray-300 rounded">
<h3 className="mb-3 text-xl font-semibold text-gray-700"> {t('publish-map-area')}</h3>
<ul>
{ publishedPlaces === '[]' ?
{ publishedPlaces.length > 0 ?
<>
{publishedPlaces.map(place => (
<li key={place.id} className="cursor-pointer place-item flex justify-between hover:bg-green-100 items-center p-2 border border-gray-300 rounded m-2"
Expand Down
1 change: 0 additions & 1 deletion src/pages/publish-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ const PublishMapPage = () => {
if (!publishedPlaces.some(p => p.id === place.id)) {
setPublishedPlaces(prevPlaces => [...prevPlaces, place]);
}

};
const handleSelectPlace = (place) => {
if (selectedPlace === null || !selectedPlace || selectedPlace.id !== place.id ) {
Expand Down

1 comment on commit b4e4366

@vercel
Copy link

@vercel vercel bot commented on b4e4366 Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.