Skip to content

Commit def49b2

Browse files
committed
Update data
1 parent eaff45b commit def49b2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/app/src/discovery/engine.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,16 @@ impl From<&Profile> for MeiliProfileDocument {
3434
header: profile.header.clone(),
3535
display: profile.display.clone(),
3636
bio: profile.records.get("bio").cloned(),
37-
addresses: Some(profile.chains.iter().map(|(chain, address)| (chain.to_string(), address.to_string())).collect()),
38-
records: Some(profile.records.clone().into_iter().collect()),
37+
addresses: if profile.chains.is_empty() {
38+
None
39+
} else {
40+
Some(profile.chains.iter().map(|(chain, address)| (chain.to_string(), address.to_string())).collect())
41+
},
42+
records: if profile.records.is_empty() {
43+
None
44+
} else {
45+
Some(profile.records.clone().into_iter().collect())
46+
},
3947
fresh: profile.fresh,
4048
}
4149
}

0 commit comments

Comments
 (0)