mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-12-21 07:50:10 +00:00
837a8e15d8
* refactor(frontend): shouldCollapsedを共通化 * refactor(frontend): config.js, worker-multi-dispatch.js, intl-const.jsを共通化 * fix(frontend-shared): fix type error * refactor(frontend): is-link.jsと、同一の振る舞いをする記述を共通化 * fix * fix lint * lint fixes
22 lines
616 B
TypeScript
22 lines
616 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
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) ||
|
|
(urls.length >= 4)
|
|
)) || (note.files != null && note.files.length >= 5)
|
|
);
|
|
|
|
return collapsed;
|
|
}
|