* Only display web push notifications after API call (fixes #7902) * Decode then truncate instead of truncating then decoding in webpush serializer
This commit is contained in:
parent
f9b23a5d62
commit
7786e1357b
2 changed files with 13 additions and 11 deletions
|
@ -33,7 +33,7 @@ class Web::NotificationSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def body
|
||||
str = truncate(strip_tags(object.target_status&.spoiler_text&.presence || object.target_status&.text || object.from_account.note), length: 140)
|
||||
HTMLEntities.new.decode(str.to_str) # Do not encode entities, since this value will not be used in HTML
|
||||
str = strip_tags(object.target_status&.spoiler_text&.presence || object.target_status&.text || object.from_account.note)
|
||||
truncate(HTMLEntities.new.decode(str.to_str), length: 140) # Do not encode entities, since this value will not be used in HTML
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue