Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿

Refactor attachment removal and enhance avatar type safety in NewAttachments and getAvatar components

yoginth.com bc7934dc 28832886

verified
+10 -5
+2 -4
apps/web/src/components/Composer/NewAttachments.tsx
··· 48 48 } 49 49 }, [videoRef, attachments]); 50 50 51 - const handleRemoveAttachment = (attachment: any) => { 51 + const handleRemoveAttachment = (attachment: NewAttachment) => { 52 52 const arr = attachments; 53 53 setAttachments( 54 - arr.filter((element: any) => { 55 - return element !== attachment; 56 - }) 54 + arr.filter((element: NewAttachment) => element !== attachment) 57 55 ); 58 56 }; 59 57
+8 -1
packages/helpers/getAvatar.ts
··· 2 2 import imageKit from "./imageKit"; 3 3 import sanitizeDStorageUrl from "./sanitizeDStorageUrl"; 4 4 5 + interface EntityWithAvatar { 6 + metadata?: { 7 + picture?: string | null; 8 + icon?: string | null; 9 + } | null; 10 + } 11 + 5 12 const getAvatar = ( 6 - entity: any, 13 + entity: EntityWithAvatar | null | undefined, 7 14 namedTransform = TRANSFORMS.AVATAR_SMALL 8 15 ): string => { 9 16 if (!entity) {