Skip to content

Commit 74ce70e

Browse files
committed
🐛 Fix PersonFinder LazyLoading with friends
1 parent d4a119a commit 74ce70e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/react-chayns-personfinder/component/PersonFinderData.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,13 @@ export default class PersonFinderData extends Component {
171171
async handleLazyLoad() {
172172
if (!this.resultList) return;
173173

174-
const { autoLoading } = this.props;
175174
const { value, lazyLoading } = this.state;
175+
176+
if (this.showFriends() && (!value || value.trim() === '')) {
177+
return;
178+
}
179+
180+
const { autoLoading } = this.props;
176181
const { scrollTop, offsetHeight, scrollHeight } = this.resultList;
177182

178183
if (autoLoading && !lazyLoading && (scrollHeight - scrollTop - offsetHeight) <= LAZY_LOADING_SPACE) {

src/react-chayns-personfinder/utils/processRelations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default function processRelations(type, relationsRaw) {
22
const unrelated = [];
33
const related = [];
44

5-
if (relationsRaw) {
5+
if (relationsRaw && relationsRaw.length) {
66
relationsRaw.forEach((relation) => {
77
if (relation.score > 0) {
88
related.push(relation);

0 commit comments

Comments
 (0)