Fixed a bug that prevent post deletion (#23908)
* Fixed a bug that prevent post deletion * lint fix:
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
29466bd33a
Коммит
05cd245e97
@@ -218,14 +218,7 @@ export function handlePosts(state: RelationOneToOne<Post, Post> = {}, action: Ge
|
||||
const newEmbeds: PostEmbed[] = [];
|
||||
|
||||
for (const embed of otherPost.metadata.embeds) {
|
||||
if (embed.type === 'permalink' && embed.data && !('post_id' in embed.data)) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('post_id missing in post embed data for permalink.');
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(embed.data);
|
||||
}
|
||||
|
||||
if (embed.type === 'permalink' && (embed.data as PostPreviewMetadata).post_id === post.id) {
|
||||
if (embed.type === 'permalink' && embed.data && (embed.data as PostPreviewMetadata).post_id === post.id) {
|
||||
// skip if the embed is the deleted post
|
||||
continue;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user