diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-07-07 10:01:37 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-07-07 10:01:37 +0300 |
| commit | e3991db5c45c06a6102ae1576614af5b58af0103 (patch) | |
| tree | ea563bcbe213be867ae508335817ac6de3671f7a /src/services/status_poster | |
| parent | f4bdbf76917ba1eb36586ecd1a37d393f672e931 (diff) | |
| parent | 9ccc6174a73199dc3c5fabfc9a9769ab9265060a (diff) | |
fix conflicts and add error handling to media descriptions
Diffstat (limited to 'src/services/status_poster')
| -rw-r--r-- | src/services/status_poster/status_poster.service.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/services/status_poster/status_poster.service.js b/src/services/status_poster/status_poster.service.js index 7f5f501c..ac469175 100644 --- a/src/services/status_poster/status_poster.service.js +++ b/src/services/status_poster/status_poster.service.js @@ -1,7 +1,18 @@ import { map } from 'lodash' import apiService from '../api/api.service.js' -const postStatus = ({ store, status, spoilerText, visibility, sensitive, poll, media = [], inReplyToStatusId = undefined, contentType = 'text/plain' }) => { +const postStatus = ({ + store, + status, + spoilerText, + visibility, + sensitive, + poll, + media = [], + inReplyToStatusId = undefined, + contentType = 'text/plain', + preview = false +}) => { const mediaIds = map(media, 'id') return apiService.postStatus({ @@ -13,10 +24,11 @@ const postStatus = ({ store, status, spoilerText, visibility, sensitive, poll, m mediaIds, inReplyToStatusId, contentType, - poll + poll, + preview }) .then((data) => { - if (!data.error) { + if (!data.error && !preview) { store.dispatch('addNewStatuses', { statuses: [data], timeline: 'friends', @@ -35,13 +47,11 @@ const postStatus = ({ store, status, spoilerText, visibility, sensitive, poll, m const uploadMedia = ({ store, formData }) => { const credentials = store.state.users.currentUser.credentials - return apiService.uploadMedia({ credentials, formData }) } const setMediaDescription = ({ store, id, description }) => { const credentials = store.state.users.currentUser.credentials - return apiService.setMediaDescription({ credentials, id, description }) } |
