mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-06-25 09:04: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();
|
)..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() =>
|
Stream<List<UserDiscoveryAnnouncedUser>> watchAllAnnouncedUsers() =>
|
||||||
select(userDiscoveryAnnouncedUsers).watch();
|
select(userDiscoveryAnnouncedUsers).watch();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -256,8 +256,8 @@ class _ChatAskAFriendEntryState extends State<ChatAskAFriendEntry> {
|
||||||
] else ...[
|
] else ...[
|
||||||
StreamBuilder<Contact?>(
|
StreamBuilder<Contact?>(
|
||||||
stream: twonlyDB.contactsDao.watchContact(userId),
|
stream: twonlyDB.contactsDao.watchContact(userId),
|
||||||
builder: (context, snapshot) {
|
builder: (context, contactSnapshot) {
|
||||||
final contactInDb = snapshot.data;
|
final contactInDb = contactSnapshot.data;
|
||||||
if (contactInDb != null) {
|
if (contactInDb != null) {
|
||||||
return Text(
|
return Text(
|
||||||
context.lang.chatAskAFriendAddedDescription,
|
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(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -314,6 +323,8 @@ class _ChatAskAFriendEntryState extends State<ChatAskAFriendEntry> {
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue