Fix indexing error in conversation list search. #516
|
@ -314,4 +314,8 @@ class ContactInfoState extends ChangeNotifier {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// returns true only if the conversation has been accepted, and has not been blocked
|
||||||
|
bool isAccepted() {
|
||||||
|
return _accepted && !_blocked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,11 +227,11 @@ class _ContactsViewState extends State<ContactsView> {
|
||||||
|
|
||||||
var contactList = ScrollablePositionedList.separated(
|
var contactList = ScrollablePositionedList.separated(
|
||||||
itemScrollController: Provider.of<ProfileInfoState>(context).contactListScrollController,
|
itemScrollController: Provider.of<ProfileInfoState>(context).contactListScrollController,
|
||||||
itemCount: Provider.of<ContactListState>(context).num,
|
itemCount: Provider.of<ContactListState>(context).numFiltered,
|
||||||
initialScrollIndex: initialScroll,
|
initialScrollIndex: initialScroll,
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
physics: BouncingScrollPhysics(),
|
physics: BouncingScrollPhysics(),
|
||||||
semanticChildCount: Provider.of<ContactListState>(context).num,
|
semanticChildCount: Provider.of<ContactListState>(context).numFiltered,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return tiles.elementAt(index);
|
return tiles.elementAt(index);
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,7 +19,6 @@ class ContactRow extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ContactRowState extends State<ContactRow> {
|
class _ContactRowState extends State<ContactRow> {
|
||||||
|
|
||||||
bool isHover = false;
|
bool isHover = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -127,12 +126,15 @@ class _ContactRowState extends State<ContactRow> {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
))),
|
))),
|
||||||
|
Visibility(
|
||||||
Visibility(visible: Platform.isAndroid || (!Platform.isAndroid && isHover) || contact.pinned, child:
|
// only allow pinning for non-blocked and accepted conversations,
|
||||||
IconButton(
|
visible: contact.isAccepted() && (Platform.isAndroid || (!Platform.isAndroid && isHover) || contact.pinned),
|
||||||
|
child: IconButton(
|
||||||
tooltip: contact.pinned ? AppLocalizations.of(context)!.tooltipUnpinConversation : AppLocalizations.of(context)!.tooltipPinConversation,
|
tooltip: contact.pinned ? AppLocalizations.of(context)!.tooltipUnpinConversation : AppLocalizations.of(context)!.tooltipPinConversation,
|
||||||
icon: Icon(contact.pinned ? Icons.push_pin : Icons.push_pin_outlined,
|
icon: Icon(
|
||||||
color: Provider.of<Settings>(context).theme.mainTextColor,),
|
contact.pinned ? Icons.push_pin : Icons.push_pin_outlined,
|
||||||
|
color: Provider.of<Settings>(context).theme.mainTextColor,
|
||||||
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (contact.pinned) {
|
if (contact.pinned) {
|
||||||
contact.unpin(context);
|
contact.unpin(context);
|
||||||
|
|
Loading…
Reference in New Issue