From 6ed3af5a928cdfa9edac01dbce8cb654851eb7c6 Mon Sep 17 00:00:00 2001 From: otsmr Date: Mon, 20 Apr 2026 12:08:20 +0200 Subject: [PATCH] fixes small ui issues --- CHANGELOG.md | 5 +++++ lib/main.dart | 17 ++++++++++++++--- lib/src/database/daos/messages.dao.dart | 6 ++++-- lib/src/providers/purchases.provider.dart | 4 ++-- .../chat_list_components/group_list_item.dart | 1 + lib/src/views/components/verified_shield.dart | 4 +++- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 544acb7..94de973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.1.6 + +- Fix: Phantom push notification +- Fix: Smaller UI fixes + ## 0.1.5 - Fix: Reupload of media files was not working properly diff --git a/lib/main.dart b/lib/main.dart index f148c74..bfc9b38 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,10 @@ import 'dart:async'; +import 'dart:io'; import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; @@ -33,9 +35,20 @@ void main() async { globalApplicationSupportDirectory = (await getApplicationSupportDirectory()).path; + initLogger(); await initFCMService(); - final user = await getUser(); + var user = await getUser(); + + if (Platform.isIOS && user != null) { + final db = File('$globalApplicationSupportDirectory/twonly.sqlite'); + if (!db.existsSync()) { + Log.error('[twonly] IOS: App was removed and then reinstalled again...'); + await const FlutterSecureStorage().deleteAll(); + user = await getUser(); + } + } + if (user != null) { gUser = user; @@ -57,8 +70,6 @@ void main() async { await deleteLocalUserData(); } - initLogger(); - final settingsController = SettingsChangeProvider(); await settingsController.loadSettings(); diff --git a/lib/src/database/daos/messages.dao.dart b/lib/src/database/daos/messages.dao.dart index 7255ca7..64b91b4 100644 --- a/lib/src/database/daos/messages.dao.dart +++ b/lib/src/database/daos/messages.dao.dart @@ -77,7 +77,8 @@ class MessagesDao extends DatabaseAccessor with _$MessagesDaoMixin { t.groupId.equals(groupId) & // messages in groups will only be removed in case all members have received it... // so ensuring that this message is not shown in the messages anymore - t.openedAt.isBiggerThanValue(deletionTime), + (t.openedAt.isBiggerThanValue(deletionTime) | + t.openedAt.isNull()), ) ..orderBy([(t) => OrderingTerm.desc(t.createdAt)]) ..limit(1)) @@ -96,7 +97,8 @@ class MessagesDao extends DatabaseAccessor with _$MessagesDaoMixin { t.groupId.equals(groupId) & // messages in groups will only be removed in case all members have received it... // so ensuring that this message is not shown in the messages anymore - t.openedAt.isBiggerThanValue(deletionTime) & + (t.openedAt.isBiggerThanValue(deletionTime) | + t.openedAt.isNull()) & (t.isDeletedFromSender.equals(true) | (t.type.equals(MessageType.text.name).not() | t.type.equals(MessageType.media.name).not()) | diff --git a/lib/src/providers/purchases.provider.dart b/lib/src/providers/purchases.provider.dart index fd37b17..25cf150 100644 --- a/lib/src/providers/purchases.provider.dart +++ b/lib/src/providers/purchases.provider.dart @@ -70,11 +70,11 @@ class PurchasesProvider with ChangeNotifier, DiagnosticableTreeMixin { }; final response = await iapConnection.queryProductDetails(ids); if (response.notFoundIDs.isNotEmpty) { - Log.error(response.notFoundIDs); + Log.warn(response.notFoundIDs); } products = response.productDetails.map(PurchasableProduct.new).toList(); if (products.isEmpty) { - Log.error('Could not load any products from the store!'); + Log.warn('Could not load any products from the store!'); } storeState = StoreState.available; notifyListeners(); diff --git a/lib/src/views/chats/chat_list_components/group_list_item.dart b/lib/src/views/chats/chat_list_components/group_list_item.dart index d14aa3e..32fa02f 100644 --- a/lib/src/views/chats/chat_list_components/group_list_item.dart +++ b/lib/src/views/chats/chat_list_components/group_list_item.dart @@ -228,6 +228,7 @@ class _UserListItem extends State { VerifiedShield( group: widget.group, showOnlyIfVerified: true, + clickable: false, size: 12, ), ], diff --git a/lib/src/views/components/verified_shield.dart b/lib/src/views/components/verified_shield.dart index 6a6cca7..293e038 100644 --- a/lib/src/views/components/verified_shield.dart +++ b/lib/src/views/components/verified_shield.dart @@ -13,12 +13,14 @@ class VerifiedShield extends StatefulWidget { super.key, this.size = 15, this.showOnlyIfVerified = false, + this.clickable = true, }); final Group? group; final Contact? contact; final double size; final bool showOnlyIfVerified; + final bool clickable; @override State createState() => _VerifiedShieldState(); @@ -61,7 +63,7 @@ class _VerifiedShieldState extends State { Widget build(BuildContext context) { if (!isVerified && widget.showOnlyIfVerified) return Container(); return GestureDetector( - onTap: (contact == null) + onTap: (contact == null || !widget.clickable) ? null : () => context.push(Routes.settingsHelpFaqVerifyBadge), child: ColoredBox(