Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit f3931c6

Browse files
committed
fix(backup): edge-case where backup/restore would fail
1 parent 3dd087e commit f3931c6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

lib/database/tables/bios.dart

+28
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,32 @@ enum BIOSDatabase<T> with LunaTableMixin<T> {
1313
final T fallback;
1414

1515
const BIOSDatabase(this.fallback);
16+
17+
@override
18+
dynamic export() {
19+
BIOSDatabase db = this;
20+
switch (db) {
21+
case BIOSDatabase.BOOT_MODULE:
22+
return BIOSDatabase.BOOT_MODULE.read().key;
23+
default:
24+
return super.export();
25+
}
26+
}
27+
28+
@override
29+
void import(dynamic value) {
30+
BIOSDatabase db = this;
31+
dynamic result;
32+
33+
switch (db) {
34+
case BIOSDatabase.BOOT_MODULE:
35+
result = LunaModule.fromKey(value.toString());
36+
break;
37+
default:
38+
result = value;
39+
break;
40+
}
41+
42+
return super.import(result);
43+
}
1644
}

0 commit comments

Comments
 (0)