Files
Client/lib/api/marianumcloud/talk/chat/get_chat_cache.dart
T

27 lines
710 B
Dart

import '../../../request_cache.dart';
import 'get_chat.dart';
import 'get_chat_params.dart';
import 'get_chat_response.dart';
class GetChatCache extends SimpleCache<GetChatResponse> {
GetChatCache({
super.onCacheData,
super.onNetworkData,
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,
) {
start('nc-chat-$chatToken');
}
}