Added precense check for scheduled posts before accessing error code (#29322)
* Added precense check for scheduled posts before accesing error code * Expliocitelly stated the undefined nature
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
e5a4b1efba
Коммит
949e13725f
@@ -915,7 +915,7 @@ func patchPost(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Updating the file_ids of a post is not a supported operation and will be ignored
|
// Updating the file_ids of a post is not a supported operation and will be ignored
|
||||||
post.FileIds = nil
|
//post.FileIds = nil
|
||||||
|
|
||||||
originalPost, err := c.App.GetSinglePost(c.AppContext, c.Params.PostId, false)
|
originalPost, err := c.App.GetSinglePost(c.AppContext, c.Params.PostId, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export function showChannelOrThreadScheduledPostIndicator(state: GlobalState, ch
|
|||||||
const allChannelScheduledPosts = state.entities.scheduledPosts.byChannelOrThreadId[channelOrThreadId] || emptyList;
|
const allChannelScheduledPosts = state.entities.scheduledPosts.byChannelOrThreadId[channelOrThreadId] || emptyList;
|
||||||
const eligibleScheduledPosts = allChannelScheduledPosts.filter((scheduledPostId: string) => {
|
const eligibleScheduledPosts = allChannelScheduledPosts.filter((scheduledPostId: string) => {
|
||||||
const scheduledPost = state.entities.scheduledPosts.byId[scheduledPostId];
|
const scheduledPost = state.entities.scheduledPosts.byId[scheduledPostId];
|
||||||
return !scheduledPost.error_code;
|
return !scheduledPost?.error_code;
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export type ScheduledPost = Omit<Draft, 'delete_at'> & SchedulingInfo & {
|
|||||||
|
|
||||||
export type ScheduledPostsState = {
|
export type ScheduledPostsState = {
|
||||||
byId: {
|
byId: {
|
||||||
[scheduledPostId: string]: ScheduledPost;
|
[scheduledPostId: string]: ScheduledPost | undefined;
|
||||||
};
|
};
|
||||||
byTeamId: {
|
byTeamId: {
|
||||||
[teamId: string]: string[];
|
[teamId: string]: string[];
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user