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)), onPressed: () => PostWidget.showMoreMenu(context, post)),
], ],
), ),
floatingActionButton: FloatingActionButton( floatingActionButton: post.post.locked
onPressed: loggedInAction((_) => comment()), ? null
child: const Icon(Icons.comment)), : FloatingActionButton(
onPressed: loggedInAction((_) => comment()),
child: const Icon(Icons.comment),
),
body: RefreshIndicator( body: RefreshIndicator(
onRefresh: refresh, onRefresh: refresh,
child: ListView( child: ListView(

View File

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