Compose: Fix NSFW tag error on CW

stable/1.0.x
Alex Gleason 2020-06-07 15:30:21 -05:00
rodzic 74a01a7b3e
commit 4737dc6da9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -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());

Wyświetl plik

@ -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 = {