summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-19 07:20:59 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-19 07:20:59 +0900
commit790e96b13e7911301dcdd1d2dbf57e8dbaddb057 (patch)
tree5c10b8a1ec816df195a6ceba1debbf78e4aa451d /src/web/app/common/scripts
parent[Client] Fix bug (diff)
downloadsharkey-790e96b13e7911301dcdd1d2dbf57e8dbaddb057.tar.gz
sharkey-790e96b13e7911301dcdd1d2dbf57e8dbaddb057.tar.bz2
sharkey-790e96b13e7911301dcdd1d2dbf57e8dbaddb057.zip
[Client] Refactor: Better function name
Diffstat (limited to 'src/web/app/common/scripts')
-rw-r--r--src/web/app/common/scripts/get-post-summary.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/web/app/common/scripts/get-post-summary.js b/src/web/app/common/scripts/get-post-summary.js
index 9202fe7b7a..b7fe4104c6 100644
--- a/src/web/app/common/scripts/get-post-summary.js
+++ b/src/web/app/common/scripts/get-post-summary.js
@@ -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;