diff --git a/qaul_ui/packages/qaul_rpc/lib/src/libqaul_worker.dart b/qaul_ui/packages/qaul_rpc/lib/src/libqaul_worker.dart index fd0e93ba6..1d93d8512 100644 --- a/qaul_ui/packages/qaul_rpc/lib/src/libqaul_worker.dart +++ b/qaul_ui/packages/qaul_rpc/lib/src/libqaul_worker.dart @@ -277,19 +277,22 @@ class LibqaulWorker { } Future> getFileHistory( - {int? page = 0, int? itemsPerPage = 20}) async { + {int page = 0, int itemsPerPage = 20}) async { Future sendFileHistoryRequest() async { final msg = ChatFile( - fileHistory: FileHistoryRequest(offset: page, limit: itemsPerPage), - ); + fileHistory: FileHistoryRequest( + offset: page * itemsPerPage, + limit: itemsPerPage, + )); await _sendMessage(Modules.CHATFILE, msg); } List newItems = []; try { + await sendFileHistoryRequest(); + for (var i = 0; i < 5; i++) { - await sendFileHistoryRequest(); - await Future.delayed(Duration(milliseconds: (i + 1) * 10)); + await Future.delayed(Duration(milliseconds: (i + 1) * 500)); newItems = _reader(fileHistoryEntitiesProvider); if (newItems.isNotEmpty) break; }