prepareStatus: nsfw tag parsing.
This commit is contained in:
parent
5888697c0d
commit
59647798b9
2 changed files with 28 additions and 2 deletions
|
@ -114,6 +114,15 @@ export const findMaxId = (...args) => {
|
|||
return (maxBy(flatten(args), 'id') || {}).id
|
||||
}
|
||||
|
||||
export const prepareStatus = (status) => {
|
||||
if (status.nsfw === undefined) {
|
||||
const nsfwRegex = /#nsfw/i
|
||||
status.nsfw = !!status.text.match(nsfwRegex)
|
||||
}
|
||||
|
||||
return status
|
||||
}
|
||||
|
||||
export const mutations = {
|
||||
addNewStatuses (state, { statuses, showImmediately = false, timeline }) {
|
||||
const timelineObject = state.timelines[timeline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue