diff --git a/lib/src/database/daos/groups.dao.dart b/lib/src/database/daos/groups.dao.dart index 85ce7ec..89730f5 100644 --- a/lib/src/database/daos/groups.dao.dart +++ b/lib/src/database/daos/groups.dao.dart @@ -322,11 +322,11 @@ class GroupsDao extends DatabaseAccessor with _$GroupsDaoMixin { flameCounter += 1; lastFlameCounterChange = Value(timestamp); // Overwrite max flame counter either the current is bigger or the th max flame counter is older then 4 days - if ((flameCounter + 1) >= maxFlameCounter || + if (flameCounter >= maxFlameCounter || maxFlameCounterFrom == null || maxFlameCounterFrom .isBefore(DateTime.now().subtract(const Duration(days: 5)))) { - maxFlameCounter = flameCounter + 1; + maxFlameCounter = flameCounter; maxFlameCounterFrom = DateTime.now(); } } diff --git a/lib/src/utils/storage.dart b/lib/src/utils/storage.dart index 9466769..db474dc 100644 --- a/lib/src/utils/storage.dart +++ b/lib/src/utils/storage.dart @@ -59,6 +59,10 @@ Future updateUserdata( final userData = await updateProtection.protect(() async { final user = await getUser(); if (user == null) return null; + if (user.defaultShowTime == 999999) { + // This was the old version for infinity -> change it to null + user.defaultShowTime = null; + } final updated = updateUser(user); await const FlutterSecureStorage() .write(key: SecureStorageKeys.userData, value: jsonEncode(updated)); diff --git a/lib/src/views/components/max_flame_list_title.dart b/lib/src/views/components/max_flame_list_title.dart index ba490e8..3476797 100644 --- a/lib/src/views/components/max_flame_list_title.dart +++ b/lib/src/views/components/max_flame_list_title.dart @@ -36,8 +36,8 @@ class _MaxFlameListTitleState extends State { _flameCounterSub = stream.listen((counter) { if (mounted) { setState(() { - _flameCounter = counter - - 1; // in the watchFlameCounter a one is added, so remove this here + // in the watchFlameCounter a one is added, so remove this here + _flameCounter = counter - 1; }); } }); @@ -84,7 +84,7 @@ class _MaxFlameListTitleState extends State { @override Widget build(BuildContext context) { if (_directChat == null || - _directChat!.maxFlameCounter == 0 || + _directChat!.maxFlameCounter <= 2 || _flameCounter >= _directChat!.maxFlameCounter || _directChat!.maxFlameCounterFrom! .isBefore(DateTime.now().subtract(const Duration(days: 4)))) {