feat: record reply

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-08 11:25:20 +08:00
parent 1e83a23c5c
commit a1f15b5da5
10 changed files with 199 additions and 13 deletions

View File

@@ -110,6 +110,7 @@ abstract final class PageUtils {
String? id,
Object? rid,
bool off = false,
Object? type,
}) async {
assert(id != null || rid != null);
SmartDialog.showLoading();
@@ -139,7 +140,7 @@ abstract final class PageUtils {
);
}
} else {
res.toast();
SmartDialog.showToast('${type != null ? 'type: $type ' : ''}$res');
}
}

View File

@@ -20,6 +20,7 @@ abstract final class GStorage {
static late final Box<dynamic> setting;
static late final Box<dynamic> video;
static late final Box<int> watchProgress;
static late final Box<Map> reply;
static Future<void> init() async {
await Hive.initFlutter(path.join(appSupportDirPath, 'hive'));
@@ -58,6 +59,12 @@ abstract final class GStorage {
return deletedEntries > 4;
},
).then((res) => watchProgress = res),
Hive.openBox<Map>(
'reply',
compactionStrategy: (entries, deletedEntries) {
return deletedEntries > 10;
},
).then((res) => reply = res),
]);
}
@@ -100,6 +107,7 @@ abstract final class GStorage {
video.compact(),
Accounts.account.compact(),
watchProgress.compact(),
reply.compact(),
]);
}
@@ -112,6 +120,7 @@ abstract final class GStorage {
video.close(),
Accounts.account.close(),
watchProgress.close(),
reply.close(),
]);
}
}