diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-11-21 19:34:19 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2022-11-21 19:34:19 +0000 |
| commit | 513b81a23bd3d6aa308f538a2705d690fe90dc40 (patch) | |
| tree | e4a815ae42241e2a6b02fbf4251db1f0bde65bf7 /src/modules/instance.js | |
| parent | 8a87d82b7baf6cd8c4d1f33ee04d9fa1a25ae825 (diff) | |
| parent | d30e39ca32caf33ccaef7ec1b1c2756456bdb0e0 (diff) | |
Merge branch 'from/develop/tusooa/remote-xact' into 'develop'
Remote interaction with posts: frontend part
See merge request pleroma/pleroma-fe!1419
Diffstat (limited to 'src/modules/instance.js')
| -rw-r--r-- | src/modules/instance.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/modules/instance.js b/src/modules/instance.js index b1bc9779..3b15e62e 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -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: { |
