Disable commenting on locked posts, fixes #159

This commit is contained in:
shilangyu 2021-04-06 16:06:07 +02:00
parent fba51bb364
commit d2dd388228
2 changed files with 9 additions and 4 deletions

View File

@ -115,9 +115,12 @@ class FullPostPage extends HookWidget {
onPressed: () => PostWidget.showMoreMenu(context, post)),
],
),
floatingActionButton: FloatingActionButton(
onPressed: loggedInAction((_) => comment()),
child: const Icon(Icons.comment)),
floatingActionButton: post.post.locked
? null
: FloatingActionButton(
onPressed: loggedInAction((_) => comment()),
child: const Icon(Icons.comment),
),
body: RefreshIndicator(
onRefresh: refresh,
child: ListView(

View File

@ -297,7 +297,9 @@ class CommentWidget extends HookWidget {
tooltip: L10n.of(context).more,
),
_SaveComment(commentTree.comment),
if (!isDeleted.value && !comment.comment.removed)
if (!isDeleted.value &&
!comment.comment.removed &&
!comment.post.locked)
TileAction(
icon: Icons.reply,
onPressed: loggedInAction((_) => reply()),