[feature] Always show content warning: use existing glitch feature (#1)

The modifications you made are somewhat janky; for instance, editing a toot with an existing content warning makes the UI look very weird and doesn't quite work.

Glitch already has a feature for this, so simply turn it on by default. This should do the same thing.

Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/1
Co-authored-by: julia <midnight@trainwit.ch>
Co-committed-by: julia <midnight@trainwit.ch>
This commit is contained in:
julia
2024-12-24 14:03:51 +00:00
committed by tobi
parent 56ec0085a2
commit 873838ebfe
12 changed files with 97 additions and 7 deletions

View File

@@ -30,6 +30,7 @@ import {
COMPOSE_TAG_HISTORY_UPDATE,
COMPOSE_ADVANCED_OPTIONS_CHANGE,
COMPOSE_SENSITIVITY_CHANGE,
COMPOSE_SPOILERNESS_CHANGE,
COMPOSE_SPOILER_TEXT_CHANGE,
COMPOSE_VISIBILITY_CHANGE,
COMPOSE_LANGUAGE_CHANGE,
@@ -382,6 +383,15 @@ export default function compose(state = initialState, action) {
map.set('idempotencyKey', uuid());
});
case COMPOSE_SPOILERNESS_CHANGE:
return state.withMutations(map => {
map.set('spoiler', !state.get('spoiler'));
map.set('idempotencyKey', uuid());
if (!state.get('sensitive') && state.get('media_attachments').size >= 1) {
map.set('sensitive', true);
}
});
case COMPOSE_SPOILER_TEXT_CHANGE:
return state
.set('spoiler_text', action.text)