fix like bug

This commit is contained in:
= 2023-06-10 02:48:01 +03:00
parent 4d178a3b8a
commit 2624ae4e32
2 changed files with 6 additions and 3 deletions

View File

@ -10,7 +10,8 @@ export interface EventCardIE{
lat: number,
lon: number,
oid: string,
title: string
title: string,
True?:boolean
}
enum category{
@ -31,7 +32,7 @@ enum category{
export const EventCard:React.FC<EventCardIE> = (props) =>{
let location = useLocation()
const [liked, setLiked] = useState(location.pathname == '/favorites'? true:false)
const [liked, setLiked] = useState(location.pathname == '/favorites' || props.True? true:false)
const onLiked = ()=>{
if (localStorage.getItem('token') != null){

View File

@ -120,7 +120,9 @@ export const Main: react.FC = () => {
lat={1}
lon={2}
oid={favorite.oid}
title={favorite.title} ></EventCard>
title={favorite.title}
True={true}
></EventCard>
}
else{
return null