hasTopicCached method

bool hasTopicCached(
  1. String topicId
)

Check whether a topic's chunks are cached locally.

Implementation

bool hasTopicCached(String topicId) {
  if (_db == null) return false;
  final result = _db!.select(
    'SELECT COUNT(*) as cnt FROM local_chunks WHERE topic_id = ?',
    [topicId],
  );
  return (result.first['cnt'] as int) > 0;
}