restore setTemplate

This commit is contained in:
Anton Tranelis 2024-11-02 21:55:03 +01:00
parent 3dc533676e
commit 997c31c8f5

View File

@ -24,7 +24,7 @@ export function ProfileView ({ userType, attestationApi }: { userType: string, a
const [offers, setOffers] = useState<Array<Tag>>([])
const [needs, setNeeds] = useState<Array<Tag>>([])
const [loading, setLoading] = useState<boolean>(false)
const [template/* , setTemplate */] = useState<string>('')
const [template , setTemplate] = useState<string>('')
const location = useLocation()
const items = useItems()
@ -134,6 +134,11 @@ export function ProfileView ({ userType, attestationApi }: { userType: string, a
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectPosition])
useEffect(() => {
setTemplate(item?.layer?.itemType.template || userType);
}, [userType, item])
return (
<>
{item &&