mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-28 15:53:44 +01:00
prepend re: to replies to spoiler-text
if spoiler-text doesn't already start with re:, we prepend `re: ` ourselves in replies. This implements https://github.com/tootsuite/mastodon/issues/8667 Following Plemora's example: https://git.pleroma.social/pleroma/pleroma-fe/merge_requests/318
This commit is contained in:
parent
c3ab2973c5
commit
8433bd89e4
1 changed files with 5 additions and 1 deletions
|
@ -314,8 +314,12 @@ export default function compose(state = initialState, action) {
|
|||
map.set('idempotencyKey', uuid());
|
||||
|
||||
if (action.status.get('spoiler_text').length > 0) {
|
||||
let spoiler_text = action.status.get('spoiler_text');
|
||||
if (!spoiler_text.match(/^re[: ]/i)) {
|
||||
spoiler_text = 're: '.concat(spoiler_text);
|
||||
}
|
||||
map.set('spoiler', true);
|
||||
map.set('spoiler_text', action.status.get('spoiler_text'));
|
||||
map.set('spoiler_text', spoiler_text);
|
||||
} else {
|
||||
map.set('spoiler', false);
|
||||
map.set('spoiler_text', '');
|
||||
|
|
Loading…
Reference in a new issue