diff options
author | Reverite <github@reverite.sh> | 2019-07-14 17:11:17 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-07-14 17:11:17 -0700 |
commit | 40fd56351f0a466e0e3785cca4ee27f2a9060e8a (patch) | |
tree | e4fa448c7b88988be3b8cb595d0671b21b49ab65 /app/javascript/flavours/glitch/reducers | |
parent | 7d99f12fd03cf2f861d0747c3bbcd4a8cf454d99 (diff) | |
parent | 5ccd011cc3bafc00a557dabbb47da004f3d4a381 (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r-- | app/javascript/flavours/glitch/reducers/compose.js | 1 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/reducers/local_settings.js | 1 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/reducers/reports.js | 13 |
3 files changed, 15 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index a47b8b7bd..5f176b832 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -182,6 +182,7 @@ function continueThread (state, status) { map.set('privacy', status.visibility); map.set('sensitive', false); map.update('media_attachments', list => list.clear()); + map.set('poll', null); map.set('idempotencyKey', uuid()); map.set('focusDate', new Date()); map.set('caretPosition', null); diff --git a/app/javascript/flavours/glitch/reducers/local_settings.js b/app/javascript/flavours/glitch/reducers/local_settings.js index 68e1c8424..6fd3d901b 100644 --- a/app/javascript/flavours/glitch/reducers/local_settings.js +++ b/app/javascript/flavours/glitch/reducers/local_settings.js @@ -21,6 +21,7 @@ const initialState = ImmutableMap({ inline_preview_cards: true, hicolor_privacy_icons: false, show_content_type_choice: false, + filtering_behavior: 'hide', content_warnings : ImmutableMap({ auto_unfold : false, filter : null, diff --git a/app/javascript/flavours/glitch/reducers/reports.js b/app/javascript/flavours/glitch/reducers/reports.js index fdcfb14a0..1f7f3f273 100644 --- a/app/javascript/flavours/glitch/reducers/reports.js +++ b/app/javascript/flavours/glitch/reducers/reports.js @@ -8,6 +8,9 @@ import { REPORT_COMMENT_CHANGE, REPORT_FORWARD_CHANGE, } from 'flavours/glitch/actions/reports'; +import { + TIMELINE_DELETE, +} from 'flavours/glitch/actions/timelines'; import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; const initialState = ImmutableMap({ @@ -20,6 +23,14 @@ const initialState = ImmutableMap({ }), }); +const deleteStatus = (state, id, references) => { + references.forEach(ref => { + state = deleteStatus(state, ref[0], []); + }); + + return state.updateIn(['new', 'status_ids'], ImmutableSet(), set => set.remove(id)); +}; + export default function reports(state = initialState, action) { switch(action.type) { case REPORT_INIT: @@ -58,6 +69,8 @@ export default function reports(state = initialState, action) { map.setIn(['new', 'comment'], ''); map.setIn(['new', 'isSubmitting'], false); }); + case TIMELINE_DELETE: + return deleteStatus(state, action.id, action.references); default: return state; } |