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; flameCounter += 1;
lastFlameCounterChange = Value(timestamp); lastFlameCounterChange = Value(timestamp);
// Overwrite max flame counter either the current is bigger or the th max flame counter is older then 4 days // 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 == null ||
maxFlameCounterFrom maxFlameCounterFrom
.isBefore(DateTime.now().subtract(const Duration(days: 5)))) { .isBefore(DateTime.now().subtract(const Duration(days: 5)))) {
maxFlameCounter = flameCounter + 1; maxFlameCounter = flameCounter;
maxFlameCounterFrom = DateTime.now(); maxFlameCounterFrom = DateTime.now();
} }
} }

View file

@ -59,6 +59,10 @@ Future<UserData?> updateUserdata(
final userData = await updateProtection.protect<UserData?>(() async { final userData = await updateProtection.protect<UserData?>(() async {
final user = await getUser(); final user = await getUser();
if (user == null) return null; 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); final updated = updateUser(user);
await const FlutterSecureStorage() await const FlutterSecureStorage()
.write(key: SecureStorageKeys.userData, value: jsonEncode(updated)); .write(key: SecureStorageKeys.userData, value: jsonEncode(updated));

View file

@ -36,8 +36,8 @@ class _MaxFlameListTitleState extends State<MaxFlameListTitle> {
_flameCounterSub = stream.listen((counter) { _flameCounterSub = stream.listen((counter) {
if (mounted) { if (mounted) {
setState(() { setState(() {
_flameCounter = counter - // in the watchFlameCounter a one is added, so remove this here
1; // in the watchFlameCounter a one is added, so remove this here _flameCounter = counter - 1;
}); });
} }
}); });
@ -84,7 +84,7 @@ class _MaxFlameListTitleState extends State<MaxFlameListTitle> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (_directChat == null || if (_directChat == null ||
_directChat!.maxFlameCounter == 0 || _directChat!.maxFlameCounter <= 2 ||
_flameCounter >= _directChat!.maxFlameCounter || _flameCounter >= _directChat!.maxFlameCounter ||
_directChat!.maxFlameCounterFrom! _directChat!.maxFlameCounterFrom!
.isBefore(DateTime.now().subtract(const Duration(days: 4)))) { .isBefore(DateTime.now().subtract(const Duration(days: 4)))) {