Skip to content

Commit

Permalink
chore(raygun extension): deduplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
sdwoodbury committed Sep 29, 2023
1 parent 8862f8a commit 96ee28d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions extensions/warp-ipfs/src/store/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,23 +391,19 @@ impl ConversationDocument {
continue
}
}

if let Ok(message) = document.resolve(&ipfs, &did, keystore.as_ref()).await {
if option.pinned() && !message.pinned() {
continue;
}
if let Some(keyword) = option.keyword() {
if message
let should_yield = if let Some(keyword) = option.keyword() {
message
.value()
.iter()
.any(|line| line.to_lowercase().contains(&keyword.to_lowercase()))
{
if let Some(remaining) = remaining.as_mut() {
*remaining = remaining.saturating_sub(1);
}
yield message;
}
} else {
true
};
if should_yield {
if let Some(remaining) = remaining.as_mut() {
*remaining = remaining.saturating_sub(1);
}
Expand Down

0 comments on commit 96ee28d

Please sign in to comment.