Skip to content

Commit

Permalink
fix: simplify conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgrasset committed Nov 1, 2023
1 parent 2b96ee9 commit 4ad5079
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/helpers/tweet/split-tweet-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ const splitTweetText = async (
return [text + quotedStatusLinkSection];
}
}
} else {
if (text!.length <= maxChunkSize) {
return [text!];
}
} else if (text!.length <= maxChunkSize) {
return [text!];
}

return buildChunks(
Expand Down
10 changes: 4 additions & 6 deletions src/services/bluesky-sender.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,10 @@ export const blueskySenderService = async (
$type: "app.bsky.embed.recordWithMedia",
};
}
} else {
if (Object.keys(mediaRecord).length) {
embed = {
...mediaRecord.media,
};
}
} else if (Object.keys(mediaRecord).length) {
embed = {
...mediaRecord.media,
};
}

if (Object.keys(embed).length) {
Expand Down

0 comments on commit 4ad5079

Please sign in to comment.