fix reblogs showing twice in notifs

This commit is contained in:
zoe 2022-08-26 22:40:10 +02:00
parent 775ffc43bf
commit 1085653d94
2 changed files with 14 additions and 3 deletions

View File

@ -65,6 +65,7 @@ class SingleNotif extends StatelessWidget {
),
(model.post != null)
? (Post(
reblogVisible: false,
model: model.post!,
))
: const SizedBox(

View File

@ -10,8 +10,13 @@ import '../business_logic/timeline/timeline.dart' as tl;
import '../business_logic/interactions/interactions.dart' as interactions;
class Post extends StatefulWidget {
const Post({required this.model, Key? key}) : super(key: key);
const Post({
required this.model,
Key? key,
this.reblogVisible = true,
}) : super(key: key);
final tl.PostModel model;
final bool reblogVisible;
@override
State<Post> createState() => _PostState();
@ -32,7 +37,10 @@ class _PostState extends State<Post> {
media: widget.model.attachments,
),
PostActionBar(model: widget.model),
RebloggedBy(account: widget.model.rebloggedBy),
RebloggedBy(
account: widget.model.rebloggedBy,
reblogVisible: widget.reblogVisible,
),
],
);
}
@ -86,12 +94,14 @@ class RebloggedBy extends StatelessWidget {
const RebloggedBy({
required this.account,
Key? key,
this.reblogVisible = true,
}) : super(key: key);
final AccountModel? account;
final bool reblogVisible;
@override
Widget build(BuildContext context) {
if (account != null) {
if (account != null && reblogVisible) {
return Column(
children: [
Row(