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.
|
/// A simple client used for persisting chat data locally.
|
||||||
abstract class ChatPersistenceClient {
|
abstract class ChatPersistenceClient {
|
||||||
|
/// Whether the connection is established.
|
||||||
|
bool get isConnected;
|
||||||
|
|
||||||
/// Creates a new connection to the client
|
/// Creates a new connection to the client
|
||||||
Future<void> connect(String userId);
|
Future<void> connect(String userId);
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ class StreamChatPersistenceClient extends ChatPersistenceClient {
|
|||||||
webUseIndexedDbIfSupported: _webUseIndexedDbIfSupported,
|
webUseIndexedDbIfSupported: _webUseIndexedDbIfSupported,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get isConnected => db != null;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> connect(
|
Future<void> connect(
|
||||||
String userId, {
|
String userId, {
|
||||||
|
|||||||
Reference in New Issue
Block a user