rollbackHistoryCount method

Future<int> rollbackHistoryCount(
  1. String module,
  2. String viewId
)

Get rollback history count for a view.

Implementation

Future<int> rollbackHistoryCount(String module, String viewId) async {
  if (cacheStorage == null) return 0;

  final key = '${_rollbackPrefix}${module}_${viewId}_history';
  final historyStr = await cacheStorage!.read(key);
  if (historyStr == null) return 0;

  return (jsonDecode(historyStr) as List).length;
}