do a few more remaining todos
Some checks failed
Build Docker and Deploy / Build Docker Container (push) Successful in 52s
Build Docker and Deploy / Run Unit-Tests (push) Failing after 11m24s
Build Docker and Deploy / Deploy to Server (push) Has been skipped

This commit is contained in:
2025-04-18 19:14:36 +02:00
parent 78c895547e
commit 5417796f3f
9 changed files with 123 additions and 58 deletions

View File

@@ -5,10 +5,16 @@ import 'package:simplecloudnotifier/state/interfaces.dart';
part 'fb_message.g.dart';
class FBMessageLog {
//TODO max size, auto clear old
static const MAX_SIZE = 512;
static void insert(RemoteMessage msg) {
Hive.box<FBMessage>('scn-fb-messages').add(FBMessage.fromRemoteMessage(msg));
if (!Hive.isBoxOpen('scn-fb-messages')) return;
final box = Hive.box<FBMessage>('scn-fb-messages');
box.add(FBMessage.fromRemoteMessage(msg));
while (box.length > MAX_SIZE) box.deleteAt(0);
}
}