This commit is contained in:
otsmr 2025-11-09 22:00:21 +01:00
parent b584974491
commit 85d755e46b
3 changed files with 9 additions and 5 deletions

View file

@ -322,11 +322,11 @@ class GroupsDao extends DatabaseAccessor<TwonlyDB> 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();
}
}

View file

@ -59,6 +59,10 @@ Future<UserData?> updateUserdata(
final userData = await updateProtection.protect<UserData?>(() 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));

View file

@ -36,8 +36,8 @@ class _MaxFlameListTitleState extends State<MaxFlameListTitle> {
_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<MaxFlameListTitle> {
@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)))) {