mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-06-25 06:44:07 +00:00
hide buttons if accounced user was set to be hidden
This commit is contained in:
parent
d528913e84
commit
be74a94f50
2 changed files with 62 additions and 45 deletions
|
|
@ -234,6 +234,12 @@ class UserDiscoveryDao extends DatabaseAccessor<TwonlyDB>
|
|||
)..where((tbl) => tbl.announcedUserId.equals(id))).getSingleOrNull();
|
||||
}
|
||||
|
||||
Stream<UserDiscoveryAnnouncedUser?> watchAnnouncedUser(int id) {
|
||||
return (select(userDiscoveryAnnouncedUsers)
|
||||
..where((tbl) => tbl.announcedUserId.equals(id)))
|
||||
.watchSingleOrNull();
|
||||
}
|
||||
|
||||
Stream<List<UserDiscoveryAnnouncedUser>> watchAllAnnouncedUsers() =>
|
||||
select(userDiscoveryAnnouncedUsers).watch();
|
||||
|
||||
|
|
|
|||
|
|
@ -256,8 +256,8 @@ class _ChatAskAFriendEntryState extends State<ChatAskAFriendEntry> {
|
|||
] else ...[
|
||||
StreamBuilder<Contact?>(
|
||||
stream: twonlyDB.contactsDao.watchContact(userId),
|
||||
builder: (context, snapshot) {
|
||||
final contactInDb = snapshot.data;
|
||||
builder: (context, contactSnapshot) {
|
||||
final contactInDb = contactSnapshot.data;
|
||||
if (contactInDb != null) {
|
||||
return Text(
|
||||
context.lang.chatAskAFriendAddedDescription,
|
||||
|
|
@ -268,6 +268,15 @@ class _ChatAskAFriendEntryState extends State<ChatAskAFriendEntry> {
|
|||
);
|
||||
}
|
||||
|
||||
return StreamBuilder<UserDiscoveryAnnouncedUser?>(
|
||||
stream:
|
||||
twonlyDB.userDiscoveryDao.watchAnnouncedUser(userId),
|
||||
builder: (context, userSnapshot) {
|
||||
final announcedUser = userSnapshot.data;
|
||||
if (announcedUser != null && announcedUser.isHidden) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
|
|
@ -314,6 +323,8 @@ class _ChatAskAFriendEntryState extends State<ChatAskAFriendEntry> {
|
|||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in a new issue