Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/lib/pages/apps/app_detail/app_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ class _AppDetailPageState extends State<AppDetailPage> {

await Share.share(
'https://h.omi.me/apps/${app.id}',
subject: app.name,
subject: app.name.isEmpty ? null : app.name,
sharePositionOrigin: sharePositionOrigin,
);
},
Expand Down
1 change: 1 addition & 0 deletions app/lib/pages/chat/widgets/ai_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,7 @@ class _MessageActionBarState extends State<MessageActionBar> {
_buildActionButton(
icon: FontAwesomeIcons.share,
onTap: () async {
if (widget.messageText.isEmpty) return;
HapticFeedback.lightImpact();
await Share.share(widget.messageText);
Comment on lines 1212 to 1215

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 The haptic feedback fires before the isEmpty guard, so if messageText is ever empty the user feels a tap response but nothing happens — no share sheet appears and no analytics are emitted. Moving the guard before the haptic keeps the feedback tied to the action actually executing.

Suggested change
onTap: () async {
HapticFeedback.lightImpact();
if (widget.messageText.isEmpty) return;
await Share.share(widget.messageText);
onTap: () async {
if (widget.messageText.isEmpty) return;
HapticFeedback.lightImpact();
await Share.share(widget.messageText);

PlatformManager.instance.analytics.track(
Expand Down
3 changes: 2 additions & 1 deletion app/lib/pages/conversation_detail/share.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ import 'package:omi/backend/schema/conversation.dart';

void shareConversationLink(ServerConversation conversation, {Rect? sharePositionOrigin}) {
final content = 'https://h.omi.me/conversations/${conversation.id}';
Share.share(content, subject: conversation.structured.title, sharePositionOrigin: sharePositionOrigin);
final subject = conversation.structured.title;
Share.share(content, subject: subject.isEmpty ? null : subject, sharePositionOrigin: sharePositionOrigin);
}
Loading