check whether persistent client is connected
This commit is contained in:
@@ -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<void> connect(String userId);
|
||||
|
||||
|
||||
@@ -79,6 +79,9 @@ class StreamChatPersistenceClient extends ChatPersistenceClient {
|
||||
webUseIndexedDbIfSupported: _webUseIndexedDbIfSupported,
|
||||
);
|
||||
|
||||
@override
|
||||
bool get isConnected => db != null;
|
||||
|
||||
@override
|
||||
Future<void> connect(
|
||||
String userId, {
|
||||
|
||||
Reference in New Issue
Block a user