fix(frontend): ノートにテキストがなくてもファイルが5つ以上あるときは折りたたむように (#13907)

* fix: ノートにテキストがなくてもファイルが5つ以上あるときは折りたたむように

* 冗長な記述を修正

* Update CHANGELOG.md
This commit is contained in:
KanariKanaru 2024-05-30 17:36:58 +09:00 committed by GitHub
parent eaadd643eb
commit 24d4124ffc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 9 deletions

View File

@ -73,6 +73,7 @@
- Fix: 通知をグループ化している際に、人数が正常に表示されないことがある問題を修正 - Fix: 通知をグループ化している際に、人数が正常に表示されないことがある問題を修正
- Fix: 連合なしの状態の読み書きができない問題を修正 - Fix: 連合なしの状態の読み書きができない問題を修正
- Fix: `/share` で日本語等を含むurlがurlエンコードされない問題を修正 - Fix: `/share` で日本語等を含むurlがurlエンコードされない問題を修正
- Fix: ファイルを5つ以上添付してもテキストがないとートが折りたたまれない問題を修正
### Server ### Server
- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに - Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに

View File

@ -6,15 +6,16 @@
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): boolean { export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): boolean {
const collapsed = note.cw == null && note.text != null && ( const collapsed = note.cw == null && (
(note.text.includes('$[x2')) || note.text != null && (
(note.text.includes('$[x3')) || (note.text.includes('$[x2')) ||
(note.text.includes('$[x4')) || (note.text.includes('$[x3')) ||
(note.text.includes('$[scale')) || (note.text.includes('$[x4')) ||
(note.text.split('\n').length > 9) || (note.text.includes('$[scale')) ||
(note.text.length > 500) || (note.text.split('\n').length > 9) ||
(note.files.length >= 5) || (note.text.length > 500) ||
(urls.length >= 4) (urls.length >= 4)
) || note.files.length >= 5
); );
return collapsed; return collapsed;