Do not use reblogIcon before initialization
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
b0363607c8
commit
c5e34de79a
|
@ -531,6 +531,16 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
'😩': messages.reactionWeary,
|
'😩': messages.reactionWeary,
|
||||||
}[meEmojiReact] || messages.favourite);
|
}[meEmojiReact] || messages.favourite);
|
||||||
|
|
||||||
|
const menu = this._makeMenu(publicStatus);
|
||||||
|
let reblogIcon = require('feather-icons/dist/icons/repeat.svg');
|
||||||
|
let replyTitle;
|
||||||
|
|
||||||
|
if (status.get('visibility') === 'direct') {
|
||||||
|
reblogIcon = require('@tabler/icons/icons/mail.svg');
|
||||||
|
} else if (status.get('visibility') === 'private') {
|
||||||
|
reblogIcon = require('@tabler/icons/icons/lock.svg');
|
||||||
|
}
|
||||||
|
|
||||||
let reblogButton;
|
let reblogButton;
|
||||||
|
|
||||||
if (me && features.quotePosts) {
|
if (me && features.quotePosts) {
|
||||||
|
@ -572,16 +582,6 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const menu = this._makeMenu(publicStatus);
|
|
||||||
let reblogIcon = require('feather-icons/dist/icons/repeat.svg');
|
|
||||||
let replyTitle;
|
|
||||||
|
|
||||||
if (status.get('visibility') === 'direct') {
|
|
||||||
reblogIcon = require('@tabler/icons/icons/mail.svg');
|
|
||||||
} else if (status.get('visibility') === 'private') {
|
|
||||||
reblogIcon = require('@tabler/icons/icons/lock.svg');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status.get('in_reply_to_id', null) === null) {
|
if (status.get('in_reply_to_id', null) === null) {
|
||||||
replyTitle = intl.formatMessage(messages.reply);
|
replyTitle = intl.formatMessage(messages.reply);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -330,47 +330,6 @@ class ActionBar extends React.PureComponent {
|
||||||
'😩': messages.reactionWeary,
|
'😩': messages.reactionWeary,
|
||||||
}[meEmojiReact] || messages.favourite);
|
}[meEmojiReact] || messages.favourite);
|
||||||
|
|
||||||
let reblogButton;
|
|
||||||
|
|
||||||
if (me && features.quotePosts) {
|
|
||||||
const reblogMenu = [
|
|
||||||
{
|
|
||||||
text: intl.formatMessage(status.get('reblogged') ? messages.cancel_reblog_private : messages.reblog),
|
|
||||||
action: this.handleReblogClick,
|
|
||||||
icon: require('@tabler/icons/icons/repeat.svg'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: intl.formatMessage(messages.quotePost),
|
|
||||||
action: this.handleQuoteClick,
|
|
||||||
icon: require('@tabler/icons/icons/quote.svg'),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
reblogButton = (
|
|
||||||
<DropdownMenuContainer
|
|
||||||
items={reblogMenu}
|
|
||||||
disabled={!publicStatus}
|
|
||||||
active={status.get('reblogged')}
|
|
||||||
pressed={status.get('reblogged')}
|
|
||||||
title={!publicStatus ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)}
|
|
||||||
src={require('@tabler/icons/icons/repeat.svg')}
|
|
||||||
direction='right'
|
|
||||||
text={intl.formatMessage(messages.reblog)}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
reblogButton = (
|
|
||||||
<IconButton
|
|
||||||
disabled={reblog_disabled}
|
|
||||||
active={status.get('reblogged')}
|
|
||||||
title={reblog_disabled ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)}
|
|
||||||
src={reblogIcon}
|
|
||||||
onClick={this.handleReblogClick}
|
|
||||||
text={intl.formatMessage(messages.reblog)}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const menu = [];
|
const menu = [];
|
||||||
|
|
||||||
if (publicStatus) {
|
if (publicStatus) {
|
||||||
|
@ -538,6 +497,47 @@ class ActionBar extends React.PureComponent {
|
||||||
|
|
||||||
const reblog_disabled = (status.get('visibility') === 'direct' || status.get('visibility') === 'private');
|
const reblog_disabled = (status.get('visibility') === 'direct' || status.get('visibility') === 'private');
|
||||||
|
|
||||||
|
let reblogButton;
|
||||||
|
|
||||||
|
if (me && features.quotePosts) {
|
||||||
|
const reblogMenu = [
|
||||||
|
{
|
||||||
|
text: intl.formatMessage(status.get('reblogged') ? messages.cancel_reblog_private : messages.reblog),
|
||||||
|
action: this.handleReblogClick,
|
||||||
|
icon: require('@tabler/icons/icons/repeat.svg'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: intl.formatMessage(messages.quotePost),
|
||||||
|
action: this.handleQuoteClick,
|
||||||
|
icon: require('@tabler/icons/icons/quote.svg'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
reblogButton = (
|
||||||
|
<DropdownMenuContainer
|
||||||
|
items={reblogMenu}
|
||||||
|
disabled={!publicStatus}
|
||||||
|
active={status.get('reblogged')}
|
||||||
|
pressed={status.get('reblogged')}
|
||||||
|
title={!publicStatus ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)}
|
||||||
|
src={require('@tabler/icons/icons/repeat.svg')}
|
||||||
|
direction='right'
|
||||||
|
text={intl.formatMessage(messages.reblog)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
reblogButton = (
|
||||||
|
<IconButton
|
||||||
|
disabled={reblog_disabled}
|
||||||
|
active={status.get('reblogged')}
|
||||||
|
title={reblog_disabled ? intl.formatMessage(messages.cannot_reblog) : intl.formatMessage(messages.reblog)}
|
||||||
|
src={reblogIcon}
|
||||||
|
onClick={this.handleReblogClick}
|
||||||
|
text={intl.formatMessage(messages.reblog)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='detailed-status__action-bar'>
|
<div className='detailed-status__action-bar'>
|
||||||
<div className='detailed-status__button'>
|
<div className='detailed-status__button'>
|
||||||
|
|
|
@ -354,14 +354,8 @@ export default function compose(state = initialState, action) {
|
||||||
map.set('caretPosition', null);
|
map.set('caretPosition', null);
|
||||||
map.set('idempotencyKey', uuid());
|
map.set('idempotencyKey', uuid());
|
||||||
map.set('content_type', state.get('default_content_type'));
|
map.set('content_type', state.get('default_content_type'));
|
||||||
|
map.set('spoiler', false);
|
||||||
if (action.status.get('spoiler_text', '').length > 0) {
|
map.set('spoiler_text', '');
|
||||||
map.set('spoiler', true);
|
|
||||||
map.set('spoiler_text', action.status.get('spoiler_text'));
|
|
||||||
} else {
|
|
||||||
map.set('spoiler', false);
|
|
||||||
map.set('spoiler_text', '');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
case COMPOSE_SUBMIT_REQUEST:
|
case COMPOSE_SUBMIT_REQUEST:
|
||||||
return state.set('is_submitting', true);
|
return state.set('is_submitting', true);
|
||||||
|
|
Loading…
Reference in New Issue