Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit e627694

Browse files
authored
comment share fix (#129)
1 parent b0334c8 commit e627694

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/util/extensions/api.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ extension DisplayNames on UserSafe {
4141
return displayName;
4242
}
4343
}
44+
45+
extension CommentLink on Comment {
46+
String get link => 'https://$instanceHost/post/$postId/comment/$id';
47+
}

lib/widgets/comment.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,16 @@ class CommentWidget extends HookWidget {
136136
ListTile(
137137
leading: const Icon(Icons.open_in_browser),
138138
title: const Text('Open in browser'),
139-
onTap: () async => await ul.canLaunch(com.comment.apId)
140-
? ul.launch(com.comment.apId)
139+
onTap: () async => await ul.canLaunch(com.comment.link)
140+
? ul.launch(com.comment.link)
141141
: Scaffold.of(context).showSnackBar(
142142
const SnackBar(content: Text("can't open in browser"))),
143143
),
144144
ListTile(
145145
leading: const Icon(Icons.share),
146146
title: const Text('Share url'),
147147
onTap: () => Share.text(
148-
'Share comment url', com.comment.apId, 'text/plain'),
148+
'Share comment url', com.comment.link, 'text/plain'),
149149
),
150150
ListTile(
151151
leading: const Icon(Icons.share),

0 commit comments

Comments
 (0)