Merge remote-tracking branch 'origin/develop' into 2-11-3-fixes

This commit is contained in:
Henry Jameson 2026-08-12 00:28:32 +03:00
commit a125a9af6c
117 changed files with 591 additions and 557 deletions

View file

@ -237,10 +237,10 @@ export const changeStatusScope = ({
credentials,
}) => {
const payload = {}
if (typeof sensitive !== 'undefined') {
if (sensitive !== undefined) {
payload['sensitive'] = sensitive
}
if (typeof visibility !== 'undefined') {
if (visibility !== undefined) {
payload['visibility'] = visibility
}
@ -260,15 +260,15 @@ export const announcementToPayload = ({
}) => {
const payload = { content }
if (typeof startsAt !== 'undefined') {
if (startsAt !== undefined) {
payload.starts_at = startsAt ? new Date(startsAt).toISOString() : null
}
if (typeof endsAt !== 'undefined') {
if (endsAt !== undefined) {
payload.ends_at = endsAt ? new Date(endsAt).toISOString() : null
}
if (typeof allDay !== 'undefined') {
if (allDay !== undefined) {
payload.all_day = allDay
}

View file

@ -18,7 +18,7 @@ export const chats = ({ credentials }) =>
url: PLEROMA_CHATS_URL,
credentials,
}).then(({ data }) => ({
data: data.map(parseChat).filter((c) => c),
data: data.map(parseChat).filter(Boolean),
}))
export const getOrCreateChat = ({ accountId, credentials }) =>
@ -40,7 +40,7 @@ export const chatMessages = ({
method: 'GET',
credentials,
}).then(({ data }) => ({
data: data.map(parseChatMessage).filter((c) => c),
data: data.map(parseChatMessage).filter(Boolean),
}))
}

View file

@ -37,11 +37,7 @@ export const paramsString = (params = {}) => {
arrays.forEach(([k, array]) => {
array.forEach((v) => {
if (
typeof v === 'object' ||
typeof v === 'function' ||
typeof v === 'undefined'
)
if (typeof v === 'object' || typeof v === 'function' || v === undefined)
throw new TypeError('Array param cannot contain non-primitives!')
})
})