forked from Ivasoft/mattermost-mobile
Fix at mention that triggers ephemeral message (#6458)
* Fix at mention that triggers ephemeral message * Properly handle failed posts
This commit is contained in:
committed by
GitHub
parent
6a3c600c8a
commit
e481c07630
@@ -52,17 +52,6 @@ export async function handleNewPostEvent(serverUrl: string, msg: WebSocketMessag
|
||||
return;
|
||||
}
|
||||
|
||||
const models: Model[] = [];
|
||||
|
||||
const postModels = await operator.handlePosts({
|
||||
actionType: ActionType.POSTS.RECEIVED_NEW,
|
||||
order: [post.id],
|
||||
posts: [post],
|
||||
prepareRecordsOnly: true,
|
||||
});
|
||||
|
||||
models.push(...postModels);
|
||||
|
||||
const isCRTEnabled = await getIsCRTEnabled(database);
|
||||
if (isCRTEnabled) {
|
||||
await createThreadFromNewPost(serverUrl, post, false);
|
||||
@@ -119,6 +108,8 @@ export async function handleNewPostEvent(serverUrl: string, msg: WebSocketMessag
|
||||
DeviceEventEmitter.emit(Events.USER_STOP_TYPING, data);
|
||||
}
|
||||
|
||||
const models: Model[] = [];
|
||||
|
||||
const {authors} = await fetchPostAuthors(serverUrl, [post], true);
|
||||
if (authors?.length) {
|
||||
const authorsModels = await operator.handleUsers({users: authors, prepareRecordsOnly: true});
|
||||
@@ -176,6 +167,15 @@ export async function handleNewPostEvent(serverUrl: string, msg: WebSocketMessag
|
||||
}
|
||||
}
|
||||
|
||||
const postModels = await operator.handlePosts({
|
||||
actionType: ActionType.POSTS.RECEIVED_NEW,
|
||||
order: [post.id],
|
||||
posts: [post],
|
||||
prepareRecordsOnly: true,
|
||||
});
|
||||
|
||||
models.push(...postModels);
|
||||
|
||||
operator.batchRecords(models);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user