diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-02-11 00:53:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 00:53:12 +0100 |
commit | 07b46cb332ae197584e3ed3f23fe814b7793ec4c (patch) | |
tree | fd96f29719ef4f8b373262bcdf05b722822e9d78 /app/javascript/mastodon/reducers | |
parent | 8b8c6726ceff78dbd58cf6f949e1267c222d6e0b (diff) |
Add dropdown for boost privacy in boost confirmation modal (#15704)
* Various dropdown code quality fixes * Prepare support for privacy selection in boost modal * Add dropdown for boost privacy in boost confirmation modal
Diffstat (limited to 'app/javascript/mastodon/reducers')
-rw-r--r-- | app/javascript/mastodon/reducers/boosts.js | 25 | ||||
-rw-r--r-- | app/javascript/mastodon/reducers/index.js | 2 |
2 files changed, 27 insertions, 0 deletions
diff --git a/app/javascript/mastodon/reducers/boosts.js b/app/javascript/mastodon/reducers/boosts.js new file mode 100644 index 000000000..d0d825057 --- /dev/null +++ b/app/javascript/mastodon/reducers/boosts.js @@ -0,0 +1,25 @@ +import Immutable from 'immutable'; + +import { + BOOSTS_INIT_MODAL, + BOOSTS_CHANGE_PRIVACY, +} from 'mastodon/actions/boosts'; + +const initialState = Immutable.Map({ + new: Immutable.Map({ + privacy: 'public', + }), +}); + +export default function mutes(state = initialState, action) { + switch (action.type) { + case BOOSTS_INIT_MODAL: + return state.withMutations((state) => { + state.setIn(['new', 'privacy'], action.privacy); + }); + case BOOSTS_CHANGE_PRIVACY: + return state.setIn(['new', 'privacy'], action.privacy); + default: + return state; + } +} diff --git a/app/javascript/mastodon/reducers/index.js b/app/javascript/mastodon/reducers/index.js index a8fb69c27..3b3c5ae29 100644 --- a/app/javascript/mastodon/reducers/index.js +++ b/app/javascript/mastodon/reducers/index.js @@ -16,6 +16,7 @@ import push_notifications from './push_notifications'; import status_lists from './status_lists'; import mutes from './mutes'; import blocks from './blocks'; +import boosts from './boosts'; import reports from './reports'; import contexts from './contexts'; import compose from './compose'; @@ -57,6 +58,7 @@ const reducers = { push_notifications, mutes, blocks, + boosts, reports, contexts, compose, |