diff options
author | beatrix <beatrix.bitrot@gmail.com> | 2018-01-06 11:28:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-06 11:28:36 -0500 |
commit | a251c42192d0f8aa3481aae47429f4b732bfb623 (patch) | |
tree | 8b9d4b093b1e77561c9c063a2de0aa28b22abc04 /app/javascript/flavours/glitch/actions | |
parent | 2ec9a75a1de70e8b53b58c05e64a4772e5709fa3 (diff) | |
parent | c71d84885511793a1a5ef613e0e4566f85c2ffe5 (diff) |
Merge pull request #296 from glitch-soc/thread-mode
Threaded mode~
Diffstat (limited to 'app/javascript/flavours/glitch/actions')
-rw-r--r-- | app/javascript/flavours/glitch/actions/compose.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 31866d223..a88dba1b1 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -61,7 +61,7 @@ export function replyCompose(status, router) { status: status, }); - if (!getState().getIn(['compose', 'mounted'])) { + if (router && !getState().getIn(['compose', 'mounted'])) { router.push('/statuses/new'); } }; @@ -118,6 +118,11 @@ export function submitCompose() { }).then(function (response) { dispatch(submitComposeSuccess({ ...response.data })); + // If the response has no data then we can't do anything else. + if (!response.data) { + return; + } + // To make the app more responsive, immediately get the status into the columns const insertOrRefresh = (timelineId, refreshAction) => { @@ -341,10 +346,11 @@ export function unmountCompose() { }; }; -export function toggleComposeAdvancedOption(option) { +export function changeComposeAdvancedOption(option, value) { return { + option, type: COMPOSE_ADVANCED_OPTIONS_CHANGE, - option: option, + value, }; } |