kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Optimistic statuses: prepend with 末 to sort it at the end
rodzic
135b4c4d7b
commit
379d03a509
|
@ -124,7 +124,7 @@ export default class StatusList extends ImmutablePureComponent {
|
|||
|
||||
renderPendingStatus(statusId) {
|
||||
const { timelineId, withGroupAdmin, group } = this.props;
|
||||
const idempotencyKey = statusId.replace(/^pending-/, '');
|
||||
const idempotencyKey = statusId.replace(/^末pending-/, '');
|
||||
|
||||
return (
|
||||
<div className='material-status' key={statusId}>
|
||||
|
@ -168,7 +168,7 @@ export default class StatusList extends ImmutablePureComponent {
|
|||
return statusIds.map((statusId, index) => {
|
||||
if (statusId === null) {
|
||||
return this.renderLoadGap(index);
|
||||
} else if (statusId.startsWith('pending-')) {
|
||||
} else if (statusId.startsWith('末pending-')) {
|
||||
return this.renderPendingStatus(statusId);
|
||||
} else {
|
||||
return this.renderStatus(statusId);
|
||||
|
|
|
@ -487,7 +487,7 @@ class Status extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
renderPendingStatus(id) {
|
||||
const idempotencyKey = id.replace(/^pending-/, '');
|
||||
const idempotencyKey = id.replace(/^末pending-/, '');
|
||||
|
||||
return (
|
||||
<PendingStatus
|
||||
|
@ -505,7 +505,7 @@ class Status extends ImmutablePureComponent {
|
|||
return list.map(id => {
|
||||
if (id.endsWith('-tombstone')) {
|
||||
return this.renderTombstone(id);
|
||||
} else if (id.startsWith('pending-')) {
|
||||
} else if (id.startsWith('末pending-')) {
|
||||
return this.renderPendingStatus(id);
|
||||
} else {
|
||||
return this.renderStatus(id);
|
||||
|
|
|
@ -18,7 +18,7 @@ export const buildStatus = (state, pendingStatus, idempotencyKey) => {
|
|||
emojis: [],
|
||||
favourited: false,
|
||||
favourites_count: 0,
|
||||
id: `pending-${idempotencyKey}`,
|
||||
id: `末pending-${idempotencyKey}`,
|
||||
in_reply_to_account_id: null,
|
||||
in_reply_to_id: pendingStatus.get('in_reply_to_id'),
|
||||
language: null,
|
||||
|
|
|
@ -101,13 +101,13 @@ const filterContexts = (state, relationship, statuses) => {
|
|||
};
|
||||
|
||||
const importPendingStatus = (state, params, idempotencyKey) => {
|
||||
const id = `pending-${idempotencyKey}`;
|
||||
const id = `末pending-${idempotencyKey}`;
|
||||
const { in_reply_to_id } = params;
|
||||
return importStatus(state, { id, in_reply_to_id });
|
||||
};
|
||||
|
||||
const deletePendingStatus = (state, { in_reply_to_id }, idempotencyKey) => {
|
||||
const id = `pending-${idempotencyKey}`;
|
||||
const id = `末pending-${idempotencyKey}`;
|
||||
|
||||
return state.withMutations(state => {
|
||||
state.deleteIn(['inReplyTos', id]);
|
||||
|
|
|
@ -256,7 +256,7 @@ const replaceItem = (state, timelineId, oldId, newId) => {
|
|||
};
|
||||
|
||||
const importPendingStatus = (state, params, idempotencyKey) => {
|
||||
const statusId = `pending-${idempotencyKey}`;
|
||||
const statusId = `末pending-${idempotencyKey}`;
|
||||
|
||||
return state.withMutations(state => {
|
||||
const timelineIds = getTimelinesByVisibility(params.visibility);
|
||||
|
@ -268,7 +268,7 @@ const importPendingStatus = (state, params, idempotencyKey) => {
|
|||
};
|
||||
|
||||
const replacePendingStatus = (state, idempotencyKey, newId) => {
|
||||
const oldId = `pending-${idempotencyKey}`;
|
||||
const oldId = `末pending-${idempotencyKey}`;
|
||||
|
||||
state.keySeq().forEach(timelineId => {
|
||||
return replaceItem(state, timelineId, oldId, newId);
|
||||
|
|
Ładowanie…
Reference in New Issue