comment share fix (#129)

This commit is contained in:
Filip Krawczyk 2021-02-03 13:12:28 +01:00 committed by GitHub
parent b0334c8c9a
commit e627694728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -41,3 +41,7 @@ extension DisplayNames on UserSafe {
return displayName;
}
}
extension CommentLink on Comment {
String get link => 'https://$instanceHost/post/$postId/comment/$id';
}

View File

@ -136,8 +136,8 @@ class CommentWidget extends HookWidget {
ListTile(
leading: const Icon(Icons.open_in_browser),
title: const Text('Open in browser'),
onTap: () async => await ul.canLaunch(com.comment.apId)
? ul.launch(com.comment.apId)
onTap: () async => await ul.canLaunch(com.comment.link)
? ul.launch(com.comment.link)
: Scaffold.of(context).showSnackBar(
const SnackBar(content: Text("can't open in browser"))),
),
@ -145,7 +145,7 @@ class CommentWidget extends HookWidget {
leading: const Icon(Icons.share),
title: const Text('Share url'),
onTap: () => Share.text(
'Share comment url', com.comment.apId, 'text/plain'),
'Share comment url', com.comment.link, 'text/plain'),
),
ListTile(
leading: const Icon(Icons.share),