mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-23 20:33:09 +02:00
[Client] Refactor: Better function name
This commit is contained in:
parent
3b352d80cb
commit
790e96b13e
1 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
|||
const getPostSummary = post => {
|
||||
const summarize = post => {
|
||||
let summary = post.text ? post.text : '';
|
||||
|
||||
// メディアが添付されているとき
|
||||
|
@ -14,7 +14,7 @@ const getPostSummary = post => {
|
|||
// 返信のとき
|
||||
if (post.reply_to_id) {
|
||||
if (post.reply_to) {
|
||||
replySummary = getPostSummary(post.reply_to);
|
||||
replySummary = summarize(post.reply_to);
|
||||
summary += ` RE: ${replySummary}`;
|
||||
} else {
|
||||
summary += ' RE: ...';
|
||||
|
@ -24,7 +24,7 @@ const getPostSummary = post => {
|
|||
// Repostのとき
|
||||
if (post.repost_id) {
|
||||
if (post.repost) {
|
||||
repostSummary = getPostSummary(post.repost);
|
||||
repostSummary = summarize(post.repost);
|
||||
summary += ` RP: ${repostSummary}`;
|
||||
} else {
|
||||
summary += ' RP: ...';
|
||||
|
@ -34,4 +34,4 @@ const getPostSummary = post => {
|
|||
return summary.trim();
|
||||
};
|
||||
|
||||
module.exports = getPostSummary;
|
||||
module.exports = summarize;
|
||||
|
|
Loading…
Reference in a new issue