syncAll method
Sync all conversations from network
Implementation
@override
Future<Map<String, int>> syncAll({List<String> consentStates = const ['allowed']}) async {
try {
final params = <String, dynamic>{
'consentStates': consentStates,
}.jsify() as JSObject;
final result = await _promiseToFuture(
_clientManager.syncAll(params),
);
final map = _jsObjectToMap(result);
return {'numGroupsSynced': (map['numGroupsSynced'] as num?)?.toInt() ?? 0};
} catch (e) {
throw Exception('Failed to sync all: $e');
}
}