Merge branch 'more-fixes' into shigusegubu-themes3
This commit is contained in:
commit
c5549e7622
6 changed files with 23 additions and 15 deletions
|
|
@ -4,7 +4,7 @@ import { parseChat } from 'src/services/entity_normalizer/entity_normalizer.serv
|
||||||
|
|
||||||
const PLEROMA_CHATS_URL = '/api/v1/pleroma/chats'
|
const PLEROMA_CHATS_URL = '/api/v1/pleroma/chats'
|
||||||
const PLEROMA_CHAT_URL = (id) => `/api/v1/pleroma/chats/by-account-id/${id}`
|
const PLEROMA_CHAT_URL = (id) => `/api/v1/pleroma/chats/by-account-id/${id}`
|
||||||
const PLEROMA_CHAT_MESSAGES_URL = (id, { maxId, sinceId, limit }) =>
|
const PLEROMA_CHAT_MESSAGES_URL = (id, { maxId, sinceId, limit } = {}) =>
|
||||||
`/api/v1/pleroma/chats/${id}/messages${paramsString({ maxId, sinceId, limit })}`
|
`/api/v1/pleroma/chats/${id}/messages${paramsString({ maxId, sinceId, limit })}`
|
||||||
const PLEROMA_CHAT_READ_URL = (id) => `/api/v1/pleroma/chats/${id}/read`
|
const PLEROMA_CHAT_READ_URL = (id) => `/api/v1/pleroma/chats/${id}/read`
|
||||||
const PLEROMA_DELETE_CHAT_MESSAGE_URL = (chatId, messageId) =>
|
const PLEROMA_DELETE_CHAT_MESSAGE_URL = (chatId, messageId) =>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ export const paramsString = (params = {}) => {
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
if (entries.length === 0) return ''
|
|
||||||
|
|
||||||
const arrays = []
|
const arrays = []
|
||||||
const nonArrays = []
|
const nonArrays = []
|
||||||
|
|
@ -48,6 +47,8 @@ export const paramsString = (params = {}) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (nonArrays.length + arrays.length === 0) return ''
|
||||||
|
|
||||||
return (
|
return (
|
||||||
'?' +
|
'?' +
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import {
|
||||||
} from './chat_layout_utils.js'
|
} from './chat_layout_utils.js'
|
||||||
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -116,8 +117,8 @@ const Chat = {
|
||||||
'currentChat',
|
'currentChat',
|
||||||
'currentChatMessageService',
|
'currentChatMessageService',
|
||||||
'findOpenedChatByRecipientId',
|
'findOpenedChatByRecipientId',
|
||||||
'mergedConfig',
|
|
||||||
]),
|
]),
|
||||||
|
...mapPiniaState(useMergedConfigStore, ['mergedConfig']),
|
||||||
...mapPiniaState(useInterfaceStore, {
|
...mapPiniaState(useInterfaceStore, {
|
||||||
mobileLayout: (store) => store.layoutType === 'mobile',
|
mobileLayout: (store) => store.layoutType === 'mobile',
|
||||||
}),
|
}),
|
||||||
|
|
@ -381,7 +382,7 @@ const Chat = {
|
||||||
if (retriesLeft <= 0) return
|
if (retriesLeft <= 0) return
|
||||||
|
|
||||||
sendChatMessage({
|
sendChatMessage({
|
||||||
params,
|
...params,
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import UserAvatar from 'src/components/user_avatar/user_avatar.vue'
|
||||||
|
|
||||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||||
|
|
||||||
|
import { chats } from 'src/api/chats.js'
|
||||||
|
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
import { faChevronLeft, faSearch } from '@fortawesome/free-solid-svg-icons'
|
import { faChevronLeft, faSearch } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
|
@ -24,10 +26,10 @@ const chatNew = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
const { chats } = await chats({
|
const { chatList } = await chats({
|
||||||
credentials: useOAuthStore().token,
|
credentials: useOAuthStore().token,
|
||||||
})
|
})
|
||||||
chats.forEach((chat) => this.suggestions.push(chat.account))
|
chatList.forEach((chat) => this.suggestions.push(chat.account))
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
users() {
|
users() {
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,12 @@ import { computed } from 'vue'
|
||||||
import ColorInput from 'src/components/color_input/color_input.vue'
|
import ColorInput from 'src/components/color_input/color_input.vue'
|
||||||
import ContrastRatio from 'src/components/contrast_ratio/contrast_ratio.vue'
|
import ContrastRatio from 'src/components/contrast_ratio/contrast_ratio.vue'
|
||||||
|
|
||||||
import { getContrastRatio, hex2rgb } from 'src/services/color_convert/color_convert.js'
|
|
||||||
|
|
||||||
import { useInterfaceStore } from 'src/stores/interface.js'
|
import { useInterfaceStore } from 'src/stores/interface.js'
|
||||||
|
|
||||||
|
import {
|
||||||
|
getContrastRatio,
|
||||||
|
hex2rgb,
|
||||||
|
} from 'src/services/color_convert/color_convert.js'
|
||||||
import {
|
import {
|
||||||
newExporter,
|
newExporter,
|
||||||
newImporter,
|
newImporter,
|
||||||
|
|
|
||||||
|
|
@ -596,16 +596,18 @@ const PostStatusForm = {
|
||||||
? this.postHandler
|
? this.postHandler
|
||||||
: statusPoster.postStatus
|
: statusPoster.postStatus
|
||||||
|
|
||||||
postHandler(postingOptions).then((data) => {
|
postHandler(postingOptions)
|
||||||
if (!data.error) {
|
.then((data) => {
|
||||||
this.abandonDraft()
|
this.abandonDraft()
|
||||||
this.clearStatus()
|
this.clearStatus()
|
||||||
this.$emit('posted', data)
|
this.$emit('posted', data)
|
||||||
} else {
|
})
|
||||||
this.error = data.error
|
.catch((error) => {
|
||||||
}
|
this.error = error
|
||||||
this.posting = false
|
})
|
||||||
})
|
.finally(() => {
|
||||||
|
this.posting = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
previewStatus() {
|
previewStatus() {
|
||||||
if (this.emptyStatus && this.newStatus.spoilerText.trim() === '') {
|
if (this.emptyStatus && this.newStatus.spoilerText.trim() === '') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue