Merge branch 'from/develop/tusooa/remote-xact' into 'develop'

Remote interaction with posts: frontend part

See merge request pleroma/pleroma-fe!1419
This commit is contained in:
HJ 2022-11-21 19:34:19 +00:00
commit 513b81a23b
8 changed files with 49 additions and 7 deletions

View file

@ -36,6 +36,8 @@ const REGIONAL_INDICATORS = (() => {
return res
})()
const REMOTE_INTERACTION_URL = '/main/ostatus'
const defaultState = {
// Stuff from apiConfig
name: 'Pleroma FE',
@ -214,6 +216,18 @@ const instance = {
},
instanceDomain (state) {
return new URL(state.server).hostname
},
remoteInteractionLink (state) {
const server = state.server.endsWith('/') ? state.server.slice(0, -1) : state.server
const link = server + REMOTE_INTERACTION_URL
return ({ statusId, nickname }) => {
if (statusId) {
return `${link}?status_id=${statusId}`
} else {
return `${link}?nickname=${nickname}`
}
}
}
},
actions: {