Fix New Marker. Add Placeholder for Import Handling
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2021-12-08 16:41:01 -08:00
parent 30fa788b84
commit c5c0f21829
3 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import 'dart:convert';
import 'package:cwtch/main.dart';
import 'package:cwtch/models/message.dart';
import 'package:cwtch/models/profileservers.dart';
import 'package:cwtch/models/servers.dart';
@ -365,6 +366,8 @@ class CwtchNotifier {
case "FileDownloaded":
profileCN.getProfile(data["ProfileOnion"])?.downloadMarkFinished(data["FileKey"], data["FilePath"]);
break;
case "ImportingProfileEvent":
break;
default:
EnvironmentConfig.debugLog("unhandled event: $type");
}

View File

@ -631,7 +631,7 @@ class ContactInfoState extends ChangeNotifier {
set newMarker(int newVal) {
// only unreadMessages++ can set newMarker = 1;
// avoids drawing a marker when the convo is already open
if (newVal > 1) {
if (newVal >= 1) {
this._newMarker = newVal;
notifyListeners();
}

View File

@ -206,7 +206,7 @@ class MessageRowState extends State<MessageRow> with SingleTickerProviderStateMi
var mark = Provider.of<ContactInfoState>(context).newMarker;
if (mark > 0 &&
Provider.of<ContactInfoState>(context).messageCache.length > mark &&
Provider.of<ContactInfoState>(context).messageCache[mark]?.metadata.messageID == Provider.of<MessageMetadata>(context).messageID) {
Provider.of<ContactInfoState>(context).messageCache[mark - 1]?.metadata.messageID == Provider.of<MessageMetadata>(context).messageID) {
return Column(crossAxisAlignment: fromMe ? CrossAxisAlignment.end : CrossAxisAlignment.start, children: [Align(alignment: Alignment.center, child: _bubbleNew()), mr]);
} else {
return mr;