From 873eeafe2e88d655a40b8797458c872eec57dc59 Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 12 Nov 2021 10:44:15 +0900 Subject: [PATCH] get-note-summary --- packages/client/src/components/notification.vue | 2 +- packages/client/src/scripts/get-note-summary.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/notification.vue b/packages/client/src/components/notification.vue index dfe6c9dab4..3276ad4fbc 100644 --- a/packages/client/src/components/notification.vue +++ b/packages/client/src/components/notification.vue @@ -199,7 +199,7 @@ export default defineComponent({ }; return { - getNoteSummary: (text: string) => getNoteSummary(text, i18n.locale), + getNoteSummary: (text: string) => getNoteSummary(text, i18n), followRequestDone, groupInviteDone, notePage, diff --git a/packages/client/src/scripts/get-note-summary.ts b/packages/client/src/scripts/get-note-summary.ts index bd394279cb..da5ad20df2 100644 --- a/packages/client/src/scripts/get-note-summary.ts +++ b/packages/client/src/scripts/get-note-summary.ts @@ -1,11 +1,11 @@ import * as misskey from 'misskey-js'; -import { i18n } from '@/i18n'; +import { I18n } from '@/scripts/i18n'; /** * 投稿を表す文字列を取得します。 * @param {*} note (packされた)投稿 */ -export const getNoteSummary = (note: misskey.entities.Note): string => { +export const getNoteSummary = (note: misskey.entities.Note, i18n: I18n): string => { if (note.deletedAt) { return `(${i18n.locale.deletedNote})`; } @@ -36,7 +36,7 @@ export const getNoteSummary = (note: misskey.entities.Note): string => { // 返信のとき if (note.replyId) { if (note.reply) { - summary += `\n\nRE: ${getNoteSummary(note.reply)}`; + summary += `\n\nRE: ${getNoteSummary(note.reply, i18n)}`; } else { summary += '\n\nRE: ...'; } @@ -45,7 +45,7 @@ export const getNoteSummary = (note: misskey.entities.Note): string => { // Renoteのとき if (note.renoteId) { if (note.renote) { - summary += `\n\nRN: ${getNoteSummary(note.renote)}`; + summary += `\n\nRN: ${getNoteSummary(note.renote, i18n)}`; } else { summary += '\n\nRN: ...'; }