refactored chat data fetching to support separate cache and network callbacks

This commit is contained in:
2026-05-07 09:46:30 +02:00
parent 517e515ac1
commit 710e88d744
3 changed files with 27 additions and 24 deletions
@@ -5,7 +5,8 @@ import 'get_chat_response.dart';
class GetChatCache extends SimpleCache<GetChatResponse> {
GetChatCache({
required void Function(GetChatResponse) onUpdate,
super.onCacheData,
super.onNetworkData,
super.onError,
required String chatToken,
}) : super(
@@ -19,7 +20,6 @@ class GetChatCache extends SimpleCache<GetChatResponse> {
),
).run(),
fromJson: GetChatResponse.fromJson,
onUpdate: onUpdate,
) {
start('nc-chat-$chatToken');
}