~cytrogen/masto-fe

a64fc62995f21a69dca319a847c554a67f7bc0a6 — Ittihadyya 6 months ago 5919d63
Added boost confirmation modal. Shortcut `b` currently works with modal, but `Shift + b` does *not*
M app/javascript/flavours/glitch/containers/status_container.js => app/javascript/flavours/glitch/containers/status_container.js +3 -1
@@ 127,7 127,9 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
      let state = getState();
      if (state.getIn(['local_settings', 'confirm_boost_missing_media_description']) && status.get('media_attachments').some(item => !item.get('description')) && !status.get('reblogged')) {
        dispatch(initBoostModal({ status, onReblog: this.onModalReblog, missingMediaDescription: true }));
      } else if (e.shiftKey || !boostModal) {
      } else if (state.getIn(['local_settings', 'confirm_boost']) && !e.shiftKey && !status.get('reblogged')) {
        dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));
      } else if ( e.shiftKey || !boostModal) {
        this.onModalReblog(status);
      } else {
        dispatch(initBoostModal({ status, onReblog: this.onModalReblog }));

M app/javascript/flavours/glitch/features/local_settings/page/index.jsx => app/javascript/flavours/glitch/features/local_settings/page/index.jsx +2 -2
@@ 129,8 129,8 @@ class LocalSettingsPage extends PureComponent {
          
          <LocalSettingsPageItem
            settings={settings}
            item={['confirm_delete']}
            id='mastodon-settings--confirm_delete'
            item={['confirm_deletion']}
            id='mastodon-settings--confirm_deletion'
            onChange={onChange}
          >
            <FormattedMessage id='settings.confirm_post_deletion' defaultMessage='Show confirmation dialog before deleting a post' />

M app/javascript/flavours/glitch/features/status/index.jsx => app/javascript/flavours/glitch/features/status/index.jsx +2 -0
@@ 357,6 357,8 @@ class Status extends ImmutablePureComponent {
    if (signedIn) {
      if (settings.get('confirm_boost_missing_media_description') && status.get('media_attachments').some(item => !item.get('description')) && !status.get('reblogged')) {
        dispatch(initBoostModal({ status, onReblog: this.handleModalReblog, missingMediaDescription: true }));
      } else if (settings.get('confirm_boost') && !e.shiftKey && !status.get('reblogged')) {
        dispatch(initBoostModal({ status, onReblog:this.handleModalReblog}));
      } else if ((e && e.shiftKey) || !boostModal) {
        this.handleModalReblog(status);
      } else {

M app/javascript/flavours/glitch/locales/en.json => app/javascript/flavours/glitch/locales/en.json +1 -1
@@ 165,7 165,7 @@
  "settings.rewrite_mentions_username": "Rewrite with username",
  "settings.confirm_unfollow": "Show confirmation dialog before unfollowing an account",
  "settings.confirm_boost": "Show confirmation dialog before boosting",
  "settings.confirm_delete": "Show confirmation dialog before deleting a post",
  "settings.confirm_deletion": "Show confirmation dialog before deleting a post",
  "settings.shared_settings_link": "user preferences",
  "settings.show_action_bar": "Show action buttons in collapsed toots",
  "settings.show_content_type_choice": "Show content-type choice when authoring toots",

M app/javascript/flavours/glitch/reducers/local_settings.js => app/javascript/flavours/glitch/reducers/local_settings.js +3 -0
@@ 22,6 22,9 @@ const initialState = ImmutableMap({
  show_content_type_choice: true,
  tag_misleading_links: true,
  rewrite_mentions: 'no',
  confirm_unfollow: false,
  confirm_boost: false,
  confirm_deletion: false,
  content_warnings : ImmutableMap({
    auto_unfold  : false,
    filter       : null,