mark posts as read when opening
This commit is contained in:
parent
3b44a0f535
commit
d2f61e77b1
|
@ -32,11 +32,18 @@ class _HomepagePostState extends State<HomepagePost> {
|
||||||
: Theme.of(context).colorScheme.secondaryContainer.withAlpha(150),
|
: Theme.of(context).colorScheme.secondaryContainer.withAlpha(150),
|
||||||
),
|
),
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () async {
|
||||||
Navigator.of(context).push(
|
Navigator.of(context).push(
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) => ArticlePage(article: post)),
|
builder: (context) => ArticlePage(article: post)),
|
||||||
);
|
);
|
||||||
|
if (!post.isRead) {
|
||||||
|
await post.api
|
||||||
|
.request()
|
||||||
|
.markItem(post, ItemMarkType.read)
|
||||||
|
.execute();
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onLongPress: () async {
|
onLongPress: () async {
|
||||||
var theme = Theme.of(context);
|
var theme = Theme.of(context);
|
||||||
|
|
Loading…
Reference in a new issue