Use note_plain on group edit page
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
fbb258c387
commit
97dd235de3
2 changed files with 6 additions and 3 deletions
|
@ -44,7 +44,7 @@ const EditGroup: React.FC<IEditGroup> = ({ params: { groupId } }) => {
|
||||||
const header = useImageField({ maxPixels: 1920 * 1080, preview: nonDefaultHeader(group?.header) });
|
const header = useImageField({ maxPixels: 1920 * 1080, preview: nonDefaultHeader(group?.header) });
|
||||||
|
|
||||||
const displayName = useTextField(group?.display_name);
|
const displayName = useTextField(group?.display_name);
|
||||||
const note = useTextField(group?.note);
|
const note = useTextField(group?.note_plain);
|
||||||
|
|
||||||
const maxName = Number(instance.configuration.getIn(['groups', 'max_characters_name']));
|
const maxName = Number(instance.configuration.getIn(['groups', 'max_characters_name']));
|
||||||
const maxNote = Number(instance.configuration.getIn(['groups', 'max_characters_description']));
|
const maxNote = Number(instance.configuration.getIn(['groups', 'max_characters_description']));
|
||||||
|
|
|
@ -29,6 +29,9 @@ const groupSchema = z.object({
|
||||||
note: z.string().transform(note => note === '<p></p>' ? '' : note).catch(''),
|
note: z.string().transform(note => note === '<p></p>' ? '' : note).catch(''),
|
||||||
relationship: groupRelationshipSchema.nullable().catch(null), // Dummy field to be overwritten later
|
relationship: groupRelationshipSchema.nullable().catch(null), // Dummy field to be overwritten later
|
||||||
slug: z.string().catch(''), // TruthSocial
|
slug: z.string().catch(''), // TruthSocial
|
||||||
|
source: z.object({
|
||||||
|
note: z.string(),
|
||||||
|
}).optional(), // TruthSocial
|
||||||
statuses_visibility: z.string().catch('public'),
|
statuses_visibility: z.string().catch('public'),
|
||||||
tags: z.array(groupTagSchema).catch([]),
|
tags: z.array(groupTagSchema).catch([]),
|
||||||
uri: z.string().catch(''),
|
uri: z.string().catch(''),
|
||||||
|
@ -43,10 +46,10 @@ const groupSchema = z.object({
|
||||||
...group,
|
...group,
|
||||||
display_name_html: emojify(escapeTextContentForBrowser(group.display_name), customEmojiMap),
|
display_name_html: emojify(escapeTextContentForBrowser(group.display_name), customEmojiMap),
|
||||||
note_emojified: emojify(group.note, customEmojiMap),
|
note_emojified: emojify(group.note, customEmojiMap),
|
||||||
note_plain: unescapeHTML(group.note),
|
note_plain: group.source?.note || unescapeHTML(group.note),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
type Group = z.infer<typeof groupSchema>;
|
type Group = z.infer<typeof groupSchema>;
|
||||||
|
|
||||||
export { groupSchema, type Group };
|
export { groupSchema, type Group };
|
||||||
|
|
Loading…
Reference in a new issue