@linktr.ee/messaging-react 1.12.6 → 1.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linktr.ee/messaging-react",
3
- "version": "1.12.6",
3
+ "version": "1.12.7",
4
4
  "description": "React messaging components built on messaging-core for web applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -37,15 +37,23 @@ const CustomChannelPreview = React.memo<CustomChannelPreviewProps>(
37
37
  const lastMessage =
38
38
  channel?.state?.messages?.[channel.state.messages.length - 1]
39
39
 
40
- // Fallback order: text -> attachment URL -> "No messages yet"
41
40
  const getLastMessageText = () => {
42
41
  if (lastMessage?.text) return lastMessage.text
43
42
 
44
43
  const attachment = lastMessage?.attachments?.[0]
45
- if (attachment?.asset_url) return attachment.asset_url
46
- if (attachment?.image_url) return attachment.image_url
47
- if (attachment?.og_scrape_url) return attachment.og_scrape_url
48
- if (attachment?.thumb_url) return attachment.thumb_url
44
+ if (attachment) {
45
+ // Link previews - show the actual URL
46
+ if (attachment.og_scrape_url) return attachment.og_scrape_url
47
+
48
+ // Type-based detection
49
+ if (attachment.type === 'image') return '📷 Sent an image'
50
+ if (attachment.type === 'video') return '🎥 Sent a video'
51
+ if (attachment.type === 'audio') return '🎵 Sent audio'
52
+ if (attachment.type === 'file') return '📎 Sent a file'
53
+
54
+ // Fallback
55
+ return '📎 Sent an attachment'
56
+ }
49
57
 
50
58
  return 'No messages yet'
51
59
  }