Compose: Fix NSFW tag error on CW

merge-requests/59/head
Alex Gleason 4 years ago
parent 74a01a7b3e
commit 4737dc6da9
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -457,7 +457,9 @@ function insertIntoTagHistory(recognizedTags, text) {
const state = getState();
const oldHistory = state.getIn(['compose', 'tagHistory']);
const me = state.get('me');
const names = recognizedTags.map(tag => text.match(new RegExp(`#${tag.name}`, 'i'))[0].slice(1));
const names = recognizedTags
.filter(tag => text.match(new RegExp(`#${tag.name}`, 'i')))
.map(tag => tag.name);
const intersectedOldHistory = oldHistory.filter(name => names.findIndex(newName => newName.toLowerCase() === name.toLowerCase()) === -1);
names.push(...intersectedOldHistory.toJS());

@ -27,7 +27,7 @@ class Upload extends ImmutablePureComponent {
onDescriptionChange: PropTypes.func.isRequired,
onOpenFocalPoint: PropTypes.func.isRequired,
onSubmit: PropTypes.func.isRequired,
features: PropTypes.map,
features: PropTypes.object,
};
state = {

Loading…
Cancel
Save