This commit is contained in:
Henry Jameson 2026-06-22 20:54:34 +03:00
commit c697041dfc
4 changed files with 11 additions and 13 deletions

View file

@ -132,11 +132,7 @@ export const promisedRequest = async ({
) )
} }
} catch (error) { } catch (error) {
throw new Error( throw new Error(error, { url, options }, response)
error,
{ url, options },
response,
)
} }
} }

View file

@ -122,7 +122,8 @@ const MASTODON_STATUS_CONTEXT_URL = (id) => `/api/v1/statuses/${id}/context`
const MASTODON_STATUS_SOURCE_URL = (id) => `/api/v1/statuses/${id}/source` const MASTODON_STATUS_SOURCE_URL = (id) => `/api/v1/statuses/${id}/source`
const MASTODON_STATUS_HISTORY_URL = (id) => `/api/v1/statuses/${id}/history` const MASTODON_STATUS_HISTORY_URL = (id) => `/api/v1/statuses/${id}/history`
const MASTODON_USER_URL = '/api/v1/accounts' const MASTODON_USER_URL = '/api/v1/accounts'
const MASTODON_USER_LOOKUP_URL = ({ acct }) => `/api/v1/accounts/lookup${paramsString({ acct })}` const MASTODON_USER_LOOKUP_URL = ({ acct }) =>
`/api/v1/accounts/lookup${paramsString({ acct })}`
const MASTODON_POLL_URL = (id = '') => `/api/v1/polls/${id}` const MASTODON_POLL_URL = (id = '') => `/api/v1/polls/${id}`
const MASTODON_STATUS_FAVORITEDBY_URL = (id) => const MASTODON_STATUS_FAVORITEDBY_URL = (id) =>
`/api/v1/statuses/${id}/favourited_by` `/api/v1/statuses/${id}/favourited_by`

View file

@ -16,7 +16,7 @@ export function StatusCodeError(statusCode, body, options, response) {
this.statusText = body.error.error || body.error this.statusText = body.error.error || body.error
this.details = JSON && JSON.stringify ? JSON.stringify(body) : body this.details = JSON && JSON.stringify ? JSON.stringify(body) : body
this.errorData = body.error this.errorData = body.error
this.message = statusCode + ' - ' + statusText this.message = this.statusCode + ' - ' + this.statusText
this.error = body // legacy attribute this.error = body // legacy attribute
this.options = options this.options = options
this.response = response this.response = response

View file

@ -37,12 +37,13 @@ const postStatus = ({
preview, preview,
idempotencyKey, idempotencyKey,
}).then(({ data }) => { }).then(({ data }) => {
if (!preview) store.dispatch('addNewStatuses', { if (!preview)
statuses: [data], store.dispatch('addNewStatuses', {
timeline: 'friends', statuses: [data],
showImmediately: true, timeline: 'friends',
noIdUpdate: true, // To prevent missing notices on next pull. showImmediately: true,
}) noIdUpdate: true, // To prevent missing notices on next pull.
})
return data return data
}) })