Compare commits

..

2 commits

Author SHA1 Message Date
35c4cad520
Use streaming API by default 2024-01-06 21:07:26 -06:00
a3ae2aad5b
Fix emoji reactions 2024-01-06 21:07:15 -06:00
3 changed files with 7 additions and 7 deletions

View file

@ -74,7 +74,7 @@ export const defaultState = {
highlight: {}, highlight: {},
interfaceLanguage: browserLocale, interfaceLanguage: browserLocale,
hideScopeNotice: false, hideScopeNotice: false,
useStreamingApi: false, useStreamingApi: true,
sidebarRight: undefined, // instance default sidebarRight: undefined, // instance default
subjectLineBehavior: undefined, // instance default subjectLineBehavior: undefined, // instance default
alwaysShowSubjectInput: undefined, // instance default alwaysShowSubjectInput: undefined, // instance default

View file

@ -544,7 +544,7 @@ export const mutations = {
count: reaction.count + 1, count: reaction.count + 1,
me: true, me: true,
accounts: [ accounts: [
...reaction.accounts, //...reaction.accounts,
currentUser currentUser
] ]
} }
@ -734,7 +734,7 @@ const statuses = {
if (!currentUser) return if (!currentUser) return
commit('addOwnReaction', { id, emoji, currentUser }) commit('addOwnReaction', { id, emoji, currentUser })
rootState.api.backendInteractor.reactWithEmoji({ id, emoji }).then( rootState.api.backendInteractor.reactWithEmoji({ id, emoji: emoji.replaceAll(':', '') }).then(
ok => { ok => {
dispatch('fetchEmojiReactionsBy', id) dispatch('fetchEmojiReactionsBy', id)
} }
@ -745,7 +745,7 @@ const statuses = {
if (!currentUser) return if (!currentUser) return
commit('removeOwnReaction', { id, emoji, currentUser }) commit('removeOwnReaction', { id, emoji, currentUser })
rootState.api.backendInteractor.unreactWithEmoji({ id, emoji }).then( rootState.api.backendInteractor.unreactWithEmoji({ id, emoji: emoji.replaceAll(':', '') }).then(
ok => { ok => {
dispatch('fetchEmojiReactionsBy', id) dispatch('fetchEmojiReactionsBy', id)
} }

View file

@ -101,7 +101,7 @@ const MASTODON_ANNOUNCEMENTS_URL = '/api/v1/announcements'
const MASTODON_ANNOUNCEMENTS_DISMISS_URL = id => `/api/v1/announcements/${id}/dismiss` const MASTODON_ANNOUNCEMENTS_DISMISS_URL = id => `/api/v1/announcements/${id}/dismiss`
const PLEROMA_EMOJI_REACTIONS_URL = id => `/api/v1/statuses/${id}/reactions` const PLEROMA_EMOJI_REACTIONS_URL = id => `/api/v1/statuses/${id}/reactions`
const PLEROMA_EMOJI_REACT_URL = (id, emoji) => `/api/v1/statuses/${id}/react/${emoji}` const PLEROMA_EMOJI_REACT_URL = (id, emoji) => `/api/v1/statuses/${id}/react/${emoji}`
const PLEROMA_EMOJI_UNREACT_URL = (id, emoji) => `/api/v1/statuses/${id}/react/${emoji}` const PLEROMA_EMOJI_UNREACT_URL = (id, emoji) => `/api/v1/statuses/${id}/unreact/${emoji}`
const PLEROMA_BACKUP_URL = '/api/v1/pleroma/backups' const PLEROMA_BACKUP_URL = '/api/v1/pleroma/backups'
const PLEROMA_ANNOUNCEMENTS_URL = '/api/v1/pleroma/admin/announcements' const PLEROMA_ANNOUNCEMENTS_URL = '/api/v1/pleroma/admin/announcements'
const PLEROMA_POST_ANNOUNCEMENT_URL = '/api/v1/pleroma/admin/announcements' const PLEROMA_POST_ANNOUNCEMENT_URL = '/api/v1/pleroma/admin/announcements'
@ -1341,7 +1341,7 @@ const fetchEmojiReactions = ({ id, credentials }) => {
const reactWithEmoji = ({ id, emoji, credentials }) => { const reactWithEmoji = ({ id, emoji, credentials }) => {
return promisedRequest({ return promisedRequest({
url: PLEROMA_EMOJI_REACT_URL(id, encodeURIComponent(emoji)), url: PLEROMA_EMOJI_REACT_URL(id, encodeURIComponent(emoji)),
method: 'PUT', method: 'POST',
credentials credentials
}).then(parseStatus) }).then(parseStatus)
} }
@ -1349,7 +1349,7 @@ const reactWithEmoji = ({ id, emoji, credentials }) => {
const unreactWithEmoji = ({ id, emoji, credentials }) => { const unreactWithEmoji = ({ id, emoji, credentials }) => {
return promisedRequest({ return promisedRequest({
url: PLEROMA_EMOJI_UNREACT_URL(id, encodeURIComponent(emoji)), url: PLEROMA_EMOJI_UNREACT_URL(id, encodeURIComponent(emoji)),
method: 'DELETE', method: 'POST',
credentials credentials
}).then(parseStatus) }).then(parseStatus)
} }