Skip to content

Commit 7360de3

Browse files
author
Uditi Mehta
committed
add usePlaceholders property
1 parent 9f3160b commit 7360de3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/preprints/my-preprints/template.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
@model={{this.model}}
1919
@relationshipName='preprints'
2020
@pageSize={{10}}
21+
@usePlaceholders={{false}}
2122
as |list|
2223
>
2324
<list.item as |preprint|>

lib/osf-components/addon/components/paginated-list/has-many/component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export default class PaginatedHasMany extends BaseDataComponent {
3333
const model = await taskFor(this.getModelTask).perform();
3434
if (this.usePlaceholders) {
3535
await taskFor(this.loadRelatedCountTask).perform(reloading);
36+
// Don't bother querying if we already know there's nothing there.
37+
if (this.totalCount === 0) {
38+
return;
39+
}
3640
}
3741
const items = await model.queryHasMany(
3842
this.relationshipName,

0 commit comments

Comments
 (0)