kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
startsWith('tombstone-') --> endsWith('-tombstone')
rodzic
cc6d2599cb
commit
4e7d7ac378
|
@ -431,7 +431,7 @@ class Status extends ImmutablePureComponent {
|
|||
|
||||
renderChildren(list) {
|
||||
return list.map(id => {
|
||||
if (id.startsWith('tombstone-')) {
|
||||
if (id.endsWith('-tombstone')) {
|
||||
return this.renderTombstone(id);
|
||||
} else {
|
||||
return this.renderStatus(id);
|
||||
|
|
|
@ -30,7 +30,7 @@ describe('contexts reducer', () => {
|
|||
'9zIH9GTCDWEFSRt2um': '9zIH7PUdhK3Ircg4hM',
|
||||
'9zIH9fhaP9atiJoOJc': '9zIH8WYwtnUx4yDzUm',
|
||||
'9zIH8WYwtnUx4yDzUm': '9zIH7PUdhK3Ircg4hM',
|
||||
'tombstone-9zIH8WYwtnUx4yDzUm': '9zIH7mMGgc1RmJwDLM',
|
||||
'9zIH8WYwtnUx4yDzUm-tombstone': '9zIH7mMGgc1RmJwDLM',
|
||||
}),
|
||||
replies: ImmutableMap({
|
||||
'9zIH6kDXA10YqhMKqO': ImmutableOrderedSet([
|
||||
|
@ -44,11 +44,11 @@ describe('contexts reducer', () => {
|
|||
'9zIH8WYwtnUx4yDzUm': ImmutableOrderedSet([
|
||||
'9zIH9fhaP9atiJoOJc',
|
||||
]),
|
||||
'tombstone-9zIH8WYwtnUx4yDzUm': ImmutableOrderedSet([
|
||||
'9zIH8WYwtnUx4yDzUm-tombstone': ImmutableOrderedSet([
|
||||
'9zIH8WYwtnUx4yDzUm',
|
||||
]),
|
||||
'9zIH7mMGgc1RmJwDLM': ImmutableOrderedSet([
|
||||
'tombstone-9zIH8WYwtnUx4yDzUm',
|
||||
'9zIH8WYwtnUx4yDzUm-tombstone',
|
||||
]),
|
||||
}),
|
||||
}));
|
||||
|
|
|
@ -31,7 +31,7 @@ const importStatuses = (state, statuses) => {
|
|||
};
|
||||
|
||||
const insertTombstone = (state, ancestorId, descendantId) => {
|
||||
const tombstoneId = `tombstone-${descendantId}`;
|
||||
const tombstoneId = `${descendantId}-tombstone`;
|
||||
return state.withMutations(state => {
|
||||
importStatus(state, { id: tombstoneId, in_reply_to_id: ancestorId });
|
||||
importStatus(state, { id: descendantId, in_reply_to_id: tombstoneId });
|
||||
|
|
Ładowanie…
Reference in New Issue