fix(llc): Error while hiding channel and clearing message history.

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-05-02 18:51:29 +05:30
committed by xsahil03x
parent 53baa5a574
commit 2bd8defe6d
3 changed files with 10 additions and 13 deletions
@@ -1485,19 +1485,11 @@ class Channel {
/// will be removed for the user.
Future<EmptyResponse> hide({bool clearHistory = false}) async {
_checkInitialized();
final response = await _client.hideChannel(
return _client.hideChannel(
id!,
type,
clearHistory: clearHistory,
);
if (clearHistory) {
state!.truncate();
final cid = _cid;
if (cid != null) {
await _client.chatPersistenceClient?.deleteMessageByCid(cid);
}
}
return response;
}
/// Removes the hidden status for the channel.