mirror of
https://github.com/immich-app/immich.git
synced 2026-03-26 20:00:44 +03:00
feat(mobile): keep search results visible (#26498)
Search results are replaced with a spinner when loading the next page, which is quite jarring. Search results now remain visible when loading the next page with a spinner at the bottom. The next page also loads sooner, which makes it feel a lot smoother. Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -276,6 +276,19 @@ class DriftTimelineRepository extends DriftDatabaseRepository {
|
||||
origin: origin,
|
||||
);
|
||||
|
||||
TimelineQuery fromAssetStream(List<BaseAsset> Function() getAssets, Stream<int> assetCount, TimelineOrigin origin) =>
|
||||
(
|
||||
bucketSource: () async* {
|
||||
yield _generateBuckets(getAssets().length);
|
||||
yield* assetCount.map(_generateBuckets);
|
||||
},
|
||||
assetSource: (offset, count) {
|
||||
final assets = getAssets();
|
||||
return Future.value(assets.skip(offset).take(count).toList(growable: false));
|
||||
},
|
||||
origin: origin,
|
||||
);
|
||||
|
||||
TimelineQuery fromAssetsWithBuckets(List<BaseAsset> assets, TimelineOrigin origin) {
|
||||
// Sort assets by date descending and group by day
|
||||
final sorted = List<BaseAsset>.from(assets)..sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
||||
|
||||
Reference in New Issue
Block a user