Files
Client/lib/api/marianumcloud/talk/chat/getChatCache.dart
T
2026-05-05 22:00:07 +02:00

27 lines
740 B
Dart

import '../../../requestCache.dart';
import 'getChat.dart';
import 'getChatParams.dart';
import 'getChatResponse.dart';
class GetChatCache extends SimpleCache<GetChatResponse> {
GetChatCache({
required void Function(GetChatResponse) onUpdate,
super.onError,
required String chatToken,
}) : super(
cacheTime: RequestCache.cacheNothing,
loader: () => GetChat(
chatToken,
GetChatParams(
lookIntoFuture: GetChatParamsSwitch.off,
setReadMarker: GetChatParamsSwitch.on,
limit: 200,
),
).run(),
fromJson: GetChatResponse.fromJson,
onUpdate: onUpdate,
) {
start('nc-chat-$chatToken');
}
}