Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-15 12:24:39 +08:00
parent cb58822009
commit bdc524e486
29 changed files with 223 additions and 248 deletions

View File

@@ -331,15 +331,11 @@ class LiveRoomController extends GetxController {
@pragma('vm:notify-debugger-on-exception')
Future<void> prefetch() async {
final res = await LiveHttp.liveRoomDanmaPrefetch(roomId: roomId);
if (res['status']) {
if (res['data'] case List list) {
try {
messages.addAll(
list.cast<Map<String, dynamic>>().map(DanmakuMsg.fromPrefetch),
);
scrollToBottom();
} catch (_) {}
final res = await LiveHttp.liveRoomDmPrefetch(roomId: roomId);
if (res case Success(:final response)) {
if (response != null && response.isNotEmpty) {
messages.addAll(response);
scrollToBottom();
}
}
}