refactor(mobile): stack only through merging from timeline (#4598)

* mobile: remove stack selection page

* mobile: require at-least 2 assets to stack

* mobile: sort stack children by fileCreatedAt

---------

Co-authored-by: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2023-10-22 20:07:27 +00:00
committed by GitHub
parent 013da0aa3d
commit 9b418642a6
5 changed files with 22 additions and 73 deletions

View File

@@ -245,31 +245,3 @@ QueryBuilder<Asset, Asset, QAfterSortBy>? getRemoteAssetQuery(WidgetRef ref) {
.stackParentIdIsNull()
.sortByFileCreatedAtDesc();
}
QueryBuilder<Asset, Asset, QAfterSortBy>? getAssetStackSelectionQuery(
WidgetRef ref,
Asset parentAsset,
) {
final userId = ref.watch(currentUserProvider)?.isarId;
if (userId == null || !parentAsset.isRemote) {
return null;
}
return ref
.watch(dbProvider)
.assets
.where()
.remoteIdIsNotNull()
.filter()
.isArchivedEqualTo(false)
.ownerIdEqualTo(userId)
.not()
.remoteIdEqualTo(parentAsset.remoteId)
// Show existing stack children in selection page
.group(
(q) => q
.stackParentIdIsNull()
.or()
.stackParentIdEqualTo(parentAsset.remoteId),
)
.sortByFileCreatedAtDesc();
}