diff options
| author | KanariKanaru <93921745+kanarikanaru@users.noreply.github.com> | 2024-05-30 17:36:58 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-30 17:36:58 +0900 |
| commit | 24d4124ffcd3b26d2f9fbec87f917b584f494ece (patch) | |
| tree | 3a521a32e066c0592ea14b3a3236f50bba91f4c7 /packages/frontend/src | |
| parent | chore(misskey-js): fix `repository` and add `license` in `package.json` (#13902) (diff) | |
| download | sharkey-24d4124ffcd3b26d2f9fbec87f917b584f494ece.tar.gz sharkey-24d4124ffcd3b26d2f9fbec87f917b584f494ece.tar.bz2 sharkey-24d4124ffcd3b26d2f9fbec87f917b584f494ece.zip | |
fix(frontend): ノートにテキストがなくてもファイルが5つ以上あるときは折りたたむように (#13907)
* fix: ノートにテキストがなくてもファイルが5つ以上あるときは折りたたむように
* 冗長な記述を修正
* Update CHANGELOG.md
Diffstat (limited to 'packages/frontend/src')
| -rw-r--r-- | packages/frontend/src/scripts/collapsed.ts | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/packages/frontend/src/scripts/collapsed.ts b/packages/frontend/src/scripts/collapsed.ts index 237bd37c7a..4ec88a3c65 100644 --- a/packages/frontend/src/scripts/collapsed.ts +++ b/packages/frontend/src/scripts/collapsed.ts @@ -6,15 +6,16 @@ import * as Misskey from 'misskey-js'; export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): boolean { - const collapsed = note.cw == null && note.text != null && ( - (note.text.includes('$[x2')) || - (note.text.includes('$[x3')) || - (note.text.includes('$[x4')) || - (note.text.includes('$[scale')) || - (note.text.split('\n').length > 9) || - (note.text.length > 500) || - (note.files.length >= 5) || - (urls.length >= 4) + const collapsed = note.cw == null && ( + note.text != null && ( + (note.text.includes('$[x2')) || + (note.text.includes('$[x3')) || + (note.text.includes('$[x4')) || + (note.text.includes('$[scale')) || + (note.text.split('\n').length > 9) || + (note.text.length > 500) || + (urls.length >= 4) + ) || note.files.length >= 5 ); return collapsed; |