mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 11:18:41 +00:00
fix #300
This commit is contained in:
parent
b584974491
commit
85d755e46b
3 changed files with 9 additions and 5 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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)))) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue