diff --git a/packages/stream_chat/lib/src/db/chat_persistence_client.dart b/packages/stream_chat/lib/src/db/chat_persistence_client.dart index 1826c4b5..4710190e 100644 --- a/packages/stream_chat/lib/src/db/chat_persistence_client.dart +++ b/packages/stream_chat/lib/src/db/chat_persistence_client.dart @@ -14,6 +14,9 @@ import 'package:stream_chat/src/core/util/extension.dart'; /// A simple client used for persisting chat data locally. abstract class ChatPersistenceClient { + /// Whether the connection is established. + bool get isConnected; + /// Creates a new connection to the client Future connect(String userId); diff --git a/packages/stream_chat_persistence/lib/src/stream_chat_persistence_client.dart b/packages/stream_chat_persistence/lib/src/stream_chat_persistence_client.dart index 3d5a5bdb..6b910585 100644 --- a/packages/stream_chat_persistence/lib/src/stream_chat_persistence_client.dart +++ b/packages/stream_chat_persistence/lib/src/stream_chat_persistence_client.dart @@ -79,6 +79,9 @@ class StreamChatPersistenceClient extends ChatPersistenceClient { webUseIndexedDbIfSupported: _webUseIndexedDbIfSupported, ); + @override + bool get isConnected => db != null; + @override Future connect( String userId, {