Skip to content

Commit

Permalink
Reset advanced options when editing toots
Browse files Browse the repository at this point in the history
There was both an issue with threaded mode and local-only toots when editing.
When activating either option, it was preserved on edit, but changing the local-only attribute is not supported and threaded mode got stuck editing the same toot.

The local-only option will be set to the toots local-only attribute to reflect that it is a local-only toot in the compose form. This unfortunately adds an additional local-only emoji.

Signed-off-by: Plastikmensch <[email protected]>
  • Loading branch information
Plastikmensch committed Oct 31, 2023
1 parent 59893a4 commit 954f125
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/javascript/flavours/glitch/reducers/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,11 @@ export default function compose(state = initialState, action) {
map.set('spoiler_text', '');
}

map.update(
'advanced_options',
map => map.merge(new ImmutableMap({ do_not_federate: action.status.get('local_only'), threaded_mode: false })),
);

if (action.status.get('poll')) {
map.set('poll', ImmutableMap({
options: action.status.getIn(['poll', 'options']).map(x => x.get('title')),
Expand Down

0 comments on commit 954f125

Please sign in to comment.