diff options
| author | Roger Braun <roger@rogerbraun.net> | 2016-11-28 17:37:47 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2016-11-28 17:37:47 +0100 |
| commit | cc00eb898fe05a023979fe30cbc4c2490994bbfd (patch) | |
| tree | 05b83e7cca6e32ee3063cf2e76aa23434d369f61 /src/modules/statuses.js | |
| parent | 2f7e5c8770719595f3a7c2a2fd5f7ba5f15914d4 (diff) | |
Switch from moment.js to vue-timeago.
Much smaller filesize for vendor.js, although we'll have to see if all
the intervals are ok.
Diffstat (limited to 'src/modules/statuses.js')
| -rw-r--r-- | src/modules/statuses.js | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 569569f8..5d604f0d 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -1,5 +1,4 @@ -import { remove, map, slice, sortBy, toInteger, each, find, flatten, maxBy, last, merge, max, isArray } from 'lodash' -import moment from 'moment' +import { remove, slice, sortBy, toInteger, each, find, flatten, maxBy, last, merge, max, isArray } from 'lodash' import apiService from '../services/api/api.service.js' // import parse from '../services/status_parser/status_parser.js' @@ -46,22 +45,9 @@ export const prepareStatus = (status) => { status.nsfw = !!status.text.match(nsfwRegex) } - // Set created_at_parsed to initial value - status.created_at_parsed = status.created_at - return status } -export const updateTimestampsInStatuses = (statuses) => { - return map(statuses, (statusoid) => { - const status = statusoid.retweeted_status || statusoid - - // Parse date - status.created_at_parsed = moment(status.created_at).fromNow() - return status - }) -} - export const statusType = (status) => { if (status.is_post_verb) { return 'status' @@ -236,9 +222,6 @@ export const mutations = { oldTimeline.newStatusCount = 0 oldTimeline.visibleStatuses = slice(oldTimeline.statuses, 0, 50) }, - updateTimestamps (state) { - updateTimestampsInStatuses(state.allStatuses) - }, setFavorited (state, { status, value }) { const newStatus = find(state.allStatuses, status) newStatus.favorited = value |
