startsWith('tombstone-') --> endsWith('-tombstone')

notifs-dropdown
Alex Gleason 2021-04-21 18:28:43 -05:00
rodzic cc6d2599cb
commit 4e7d7ac378
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -431,7 +431,7 @@ class Status extends ImmutablePureComponent {
renderChildren(list) { renderChildren(list) {
return list.map(id => { return list.map(id => {
if (id.startsWith('tombstone-')) { if (id.endsWith('-tombstone')) {
return this.renderTombstone(id); return this.renderTombstone(id);
} else { } else {
return this.renderStatus(id); return this.renderStatus(id);

Wyświetl plik

@ -30,7 +30,7 @@ describe('contexts reducer', () => {
'9zIH9GTCDWEFSRt2um': '9zIH7PUdhK3Ircg4hM', '9zIH9GTCDWEFSRt2um': '9zIH7PUdhK3Ircg4hM',
'9zIH9fhaP9atiJoOJc': '9zIH8WYwtnUx4yDzUm', '9zIH9fhaP9atiJoOJc': '9zIH8WYwtnUx4yDzUm',
'9zIH8WYwtnUx4yDzUm': '9zIH7PUdhK3Ircg4hM', '9zIH8WYwtnUx4yDzUm': '9zIH7PUdhK3Ircg4hM',
'tombstone-9zIH8WYwtnUx4yDzUm': '9zIH7mMGgc1RmJwDLM', '9zIH8WYwtnUx4yDzUm-tombstone': '9zIH7mMGgc1RmJwDLM',
}), }),
replies: ImmutableMap({ replies: ImmutableMap({
'9zIH6kDXA10YqhMKqO': ImmutableOrderedSet([ '9zIH6kDXA10YqhMKqO': ImmutableOrderedSet([
@ -44,11 +44,11 @@ describe('contexts reducer', () => {
'9zIH8WYwtnUx4yDzUm': ImmutableOrderedSet([ '9zIH8WYwtnUx4yDzUm': ImmutableOrderedSet([
'9zIH9fhaP9atiJoOJc', '9zIH9fhaP9atiJoOJc',
]), ]),
'tombstone-9zIH8WYwtnUx4yDzUm': ImmutableOrderedSet([ '9zIH8WYwtnUx4yDzUm-tombstone': ImmutableOrderedSet([
'9zIH8WYwtnUx4yDzUm', '9zIH8WYwtnUx4yDzUm',
]), ]),
'9zIH7mMGgc1RmJwDLM': ImmutableOrderedSet([ '9zIH7mMGgc1RmJwDLM': ImmutableOrderedSet([
'tombstone-9zIH8WYwtnUx4yDzUm', '9zIH8WYwtnUx4yDzUm-tombstone',
]), ]),
}), }),
})); }));

Wyświetl plik

@ -31,7 +31,7 @@ const importStatuses = (state, statuses) => {
}; };
const insertTombstone = (state, ancestorId, descendantId) => { const insertTombstone = (state, ancestorId, descendantId) => {
const tombstoneId = `tombstone-${descendantId}`; const tombstoneId = `${descendantId}-tombstone`;
return state.withMutations(state => { return state.withMutations(state => {
importStatus(state, { id: tombstoneId, in_reply_to_id: ancestorId }); importStatus(state, { id: tombstoneId, in_reply_to_id: ancestorId });
importStatus(state, { id: descendantId, in_reply_to_id: tombstoneId }); importStatus(state, { id: descendantId, in_reply_to_id: tombstoneId });