1
0
mirror of https://git.boykissers.com/pawkey/pawkey-sk.git synced 2025-12-20 04:04:16 +00:00
Files
pawkey-sk/packages/frontend-shared/js/compute-merged-cw.ts
2025-02-16 19:20:42 -05:00

18 lines
439 B
TypeScript

/*
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as Misskey from 'misskey-js';
import { appendContentWarning } from '@/js/append-content-warning.js';
export function computeMergedCw(note: Misskey.entities.Note): string | null {
let cw = note.cw;
if (note.user.mandatoryCW) {
cw = appendContentWarning(cw, note.user.mandatoryCW);
}
return cw ?? null;
}