Small fix

This commit is contained in:
2025-06-27 12:24:47 +03:00
parent 33fb960397
commit caff9bac1f
3 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -73,7 +73,7 @@ class HiveService {
final tagBox = tags;
if (tagBox.isEmpty) {
_logger.i('Filling initial tags');
await tagBox.addAll(TagUtils.getDefaultTags());
await tagBox.addAll(TagUtils.getDefaultTags(_defaultUserId));
await tagBox.flush();
}
+9 -3
View File
@@ -16,17 +16,23 @@ class TagAdapter extends TypeAdapter<Tag> {
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Tag(id: fields[0] as String?, name: fields[1] as String);
return Tag(
id: fields[0] as String?,
name: fields[1] as String,
userId: fields[2] as String,
);
}
@override
void write(BinaryWriter writer, Tag obj) {
writer
..writeByte(2)
..writeByte(3)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.name);
..write(obj.name)
..writeByte(2)
..write(obj.userId);
}
@override
+5 -2
View File
@@ -24,13 +24,14 @@ class TransactionRecordAdapter extends TypeAdapter<TransactionRecord> {
dateTime: fields[4] as DateTime,
vendor: fields[5] as String,
currency: fields[6] as String,
userId: fields[7] as String,
);
}
@override
void write(BinaryWriter writer, TransactionRecord obj) {
writer
..writeByte(7)
..writeByte(8)
..writeByte(0)
..write(obj.id)
..writeByte(1)
@@ -44,7 +45,9 @@ class TransactionRecordAdapter extends TypeAdapter<TransactionRecord> {
..writeByte(5)
..write(obj.vendor)
..writeByte(6)
..write(obj.currency);
..write(obj.currency)
..writeByte(7)
..write(obj.userId);
}
@override