fix build, take 5
This commit is contained in:
parent
ecec59ea45
commit
960b21edc1
@ -385,17 +385,6 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
<IconButton className='status__action-bar__button' title={intl.formatMessage(messages.hide)} icon='eye' iconComponent={VisibilityIcon} onClick={this.handleHideClick} />
|
<IconButton className='status__action-bar__button' title={intl.formatMessage(messages.hide)} icon='eye' iconComponent={VisibilityIcon} onClick={this.handleHideClick} />
|
||||||
);
|
);
|
||||||
|
|
||||||
const canReact = signedIn && status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions;
|
|
||||||
const reactButton = (
|
|
||||||
<IconButton
|
|
||||||
className='status__action-bar-button'
|
|
||||||
onClick={this.handleNoOp} // EmojiPickerDropdown handles that
|
|
||||||
title={intl.formatMessage(messages.react)}
|
|
||||||
disabled={!canReact}
|
|
||||||
icon='plus'
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
const isReply = status.get('in_reply_to_account_id') === status.getIn(['account', 'id']);
|
const isReply = status.get('in_reply_to_account_id') === status.getIn(['account', 'id']);
|
||||||
const canReact = signedIn && status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions;
|
const canReact = signedIn && status.get('reactions').filter(r => r.get('count') > 0 && r.get('me')).size < maxReactions;
|
||||||
const reactButton = (
|
const reactButton = (
|
||||||
|
@ -201,11 +201,7 @@ class ActionBar extends PureComponent {
|
|||||||
navigator.clipboard.writeText(url);
|
navigator.clipboard.writeText(url);
|
||||||
};
|
};
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
handleNoOp = () => {} // hack for reaction add button
|
|
||||||
=======
|
|
||||||
handleNoOp = () => {}; // hack for reaction add button
|
handleNoOp = () => {}; // hack for reaction add button
|
||||||
>>>>>>> pr2462
|
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { status, relationship, intl } = this.props;
|
const { status, relationship, intl } = this.props;
|
||||||
@ -300,10 +296,7 @@ class ActionBar extends PureComponent {
|
|||||||
title={intl.formatMessage(messages.react)}
|
title={intl.formatMessage(messages.react)}
|
||||||
disabled={!canReact}
|
disabled={!canReact}
|
||||||
icon='plus'
|
icon='plus'
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
iconComponent={AddIcon}
|
iconComponent={AddIcon}
|
||||||
>>>>>>> pr2462
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -73,7 +73,6 @@ const initialState = ImmutableMap({
|
|||||||
favourite: true,
|
favourite: true,
|
||||||
reaction: true,
|
reaction: true,
|
||||||
reblog: true,
|
reblog: true,
|
||||||
reaction: true,
|
|
||||||
mention: true,
|
mention: true,
|
||||||
poll: true,
|
poll: true,
|
||||||
status: true,
|
status: true,
|
||||||
|
@ -105,43 +105,6 @@ const statusTranslateUndo = (state, id) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateReaction = (state, id, name, updater) => state.update(
|
|
||||||
id,
|
|
||||||
status => status.update(
|
|
||||||
'reactions',
|
|
||||||
reactions => {
|
|
||||||
const index = reactions.findIndex(reaction => reaction.get('name') === name);
|
|
||||||
if (index > -1) {
|
|
||||||
return reactions.update(index, reaction => updater(reaction));
|
|
||||||
} else {
|
|
||||||
return reactions.push(updater(fromJS({ name, count: 0 })));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
const updateReactionCount = (state, reaction) => updateReaction(state, reaction.status_id, reaction.name, x => x.set('count', reaction.count));
|
|
||||||
|
|
||||||
// The url parameter is only used when adding a new custom emoji reaction
|
|
||||||
// (one that wasn't in the reactions list before) because we don't have its
|
|
||||||
// URL yet. In all other cases, it's undefined.
|
|
||||||
const addReaction = (state, id, name, url) => updateReaction(
|
|
||||||
state,
|
|
||||||
id,
|
|
||||||
name,
|
|
||||||
x => x.set('me', true)
|
|
||||||
.update('count', n => n + 1)
|
|
||||||
.update('url', old => old ? old : url)
|
|
||||||
.update('static_url', old => old ? old : url),
|
|
||||||
);
|
|
||||||
|
|
||||||
const removeReaction = (state, id, name) => updateReaction(
|
|
||||||
state,
|
|
||||||
id,
|
|
||||||
name,
|
|
||||||
x => x.set('me', false).update('count', n => n - 1),
|
|
||||||
);
|
|
||||||
|
|
||||||
const initialState = ImmutableMap();
|
const initialState = ImmutableMap();
|
||||||
|
|
||||||
export default function statuses(state = initialState, action) {
|
export default function statuses(state = initialState, action) {
|
||||||
|
Loading…
Reference in New Issue
Block a user