Remove poll_limits
as they're not part of instancev2
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
b5668f1f70
commit
54e1b3d4e8
1 changed files with 1 additions and 10 deletions
|
@ -165,19 +165,11 @@ const instanceSchema = coerceObject({
|
|||
title: z.string().catch(''),
|
||||
usage: usageSchema,
|
||||
version: z.string().catch(''),
|
||||
}).transform(({ max_media_attachments, max_toot_chars, poll_limits, ...instance }) => {
|
||||
}).transform(({ max_media_attachments, max_toot_chars, ...instance }) => {
|
||||
const { configuration } = instance;
|
||||
|
||||
const version = fixVersion(instance.version);
|
||||
|
||||
const polls = {
|
||||
...configuration.polls,
|
||||
max_characters_per_option: configuration.polls.max_characters_per_option ?? poll_limits.max_option_chars ?? 25,
|
||||
max_expiration: configuration.polls.max_expiration ?? poll_limits.max_expiration ?? 2629746,
|
||||
max_options: configuration.polls.max_options ?? poll_limits.max_options ?? 4,
|
||||
min_expiration: configuration.polls.min_expiration ?? poll_limits.min_expiration ?? 300,
|
||||
};
|
||||
|
||||
const statuses = {
|
||||
...configuration.statuses,
|
||||
max_characters: configuration.statuses.max_characters ?? max_toot_chars ?? 500,
|
||||
|
@ -188,7 +180,6 @@ const instanceSchema = coerceObject({
|
|||
...instance,
|
||||
configuration: {
|
||||
...configuration,
|
||||
polls,
|
||||
statuses,
|
||||
},
|
||||
version,
|
||||
|
|
Loading…
Reference in a new issue