mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
use constants, truncate only comments with more than 300 characters
This commit is contained in:
parent
452bf4127c
commit
a306b9cf4b
@ -60,6 +60,7 @@
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { COMMENT_MAX_UNTRUNCATED_LENGTH, COMMENT_TRUNCATE_TO_LENGTH } from '~/constants/comment'
|
||||
import HcUser from '~/components/User/User'
|
||||
import ContentMenu from '~/components/ContentMenu'
|
||||
import ContentViewer from '~/components/Editor/ContentViewer'
|
||||
@ -98,11 +99,11 @@ export default {
|
||||
isModerator: 'auth/isModerator',
|
||||
}),
|
||||
isLongComment() {
|
||||
return this.$filters.removeHtml(this.comment.content).length > 180
|
||||
return this.$filters.removeHtml(this.comment.content).length > COMMENT_MAX_UNTRUNCATED_LENGTH
|
||||
},
|
||||
commentContent() {
|
||||
if (this.isLongComment && this.isCollapsed) {
|
||||
return this.$filters.truncate(this.comment.content, 180)
|
||||
return this.$filters.truncate(this.comment.content, COMMENT_TRUNCATE_TO_LENGTH)
|
||||
}
|
||||
|
||||
return this.comment.content
|
||||
|
||||
@ -1 +1,3 @@
|
||||
export const COMMENT_MIN_LENGTH = 1
|
||||
export const COMMENT_MAX_UNTRUNCATED_LENGTH = 300
|
||||
export const COMMENT_TRUNCATE_TO_LENGTH = 180
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user