From 9a7201f2ee8c428172840f4d842eb84ee2f24929 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 27 Nov 2018 18:25:51 +0100 Subject: Allow disabling the reply confirmation dialog --- .../flavours/glitch/features/local_settings/page/index.js | 8 ++++++++ app/javascript/flavours/glitch/features/status/index.js | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/features') diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.js b/app/javascript/flavours/glitch/features/local_settings/page/index.js index 6defdfbb6..0b607a05d 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/page/index.js @@ -126,6 +126,14 @@ export default class LocalSettingsPage extends React.PureComponent { > + + + { ancestorsIds, descendantsIds, settings: state.get('local_settings'), - askReplyConfirmation: state.getIn(['compose', 'text']).trim().length !== 0, + askReplyConfirmation: state.getIn(['local_settings', 'confirm_before_clearing_draft']) && state.getIn(['compose', 'text']).trim().length !== 0, }; }; @@ -196,6 +197,7 @@ export default class Status extends ImmutablePureComponent { dispatch(openModal('CONFIRM', { message: intl.formatMessage(messages.replyMessage), confirm: intl.formatMessage(messages.replyConfirm), + onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_before_clearing_draft'], false)), onConfirm: () => dispatch(replyCompose(status, this.context.router.history)), })); } else { -- cgit