diff --git a/lib/cwtch/cwtchNotifier.dart b/lib/cwtch/cwtchNotifier.dart index 62af116..a8ed7c6 100644 --- a/lib/cwtch/cwtchNotifier.dart +++ b/lib/cwtch/cwtchNotifier.dart @@ -40,10 +40,10 @@ class CwtchNotifier { imagePath: data["picture"], isBlocked: data["authorization"] == "blocked", isInvitation: data["authorization"] == "unknown", - savePeerHistory: data["saveConversationHistory"], + savePeerHistory: data["saveConversationHistory"] == null ? "DeleteHistoryConfirmed" : data["saveConversationHistory"], numMessages: int.parse(data["numMessages"]), numUnread: int.parse(data["unread"]), - isGroup: data["isGroup"], + isGroup: data["isGroup"] == true, server: data["groupServer"], lastMessageTime: DateTime.now(), //show at the top of the contact list even if no messages yet )); diff --git a/lib/errorHandler.dart b/lib/errorHandler.dart index ee474e3..cf26cde 100644 --- a/lib/errorHandler.dart +++ b/lib/errorHandler.dart @@ -29,6 +29,7 @@ class ErrorHandler extends ChangeNotifier { break; case importBundleErrorPrefix: handleImportBundleError(errorType); + break; } notifyListeners(); @@ -49,6 +50,7 @@ class ErrorHandler extends ChangeNotifier { break; case successErrorType: explicitAddContactSuccess = true; + importBundleSuccess = true; break; } } diff --git a/lib/model.dart b/lib/model.dart index 977639d..d7630ef 100644 --- a/lib/model.dart +++ b/lib/model.dart @@ -253,7 +253,7 @@ class ContactInfoState extends ChangeNotifier { // todo: a nicer way to model contacts, groups and other "entities" late bool _isGroup; - late String _server; + String? _server; ContactInfoState( this.profileOnion, @@ -268,7 +268,7 @@ class ContactInfoState extends ChangeNotifier { numMessages = 0, numUnread = 0, lastMessageTime, - server = "", + server, }) { this._nickname = nickname; this._isGroup = isGroup; diff --git a/lib/widgets/passwordfield.dart b/lib/widgets/passwordfield.dart index d7931ef..7b8804d 100644 --- a/lib/widgets/passwordfield.dart +++ b/lib/widgets/passwordfield.dart @@ -39,7 +39,9 @@ class _CwtchTextFieldState extends State { decoration: InputDecoration( suffixIcon: IconButton( onPressed: () { - obscureText = !obscureText; + setState(() { + obscureText = !obscureText; + }); }, icon: Icon((obscureText ? Icons.remove_red_eye : Icons.remove_red_eye_outlined), semanticLabel: label), tooltip: label,