Fix types so the store can return undefined teams (#26386)

* Fix types so the store can return undefined teams

* Fix post test

* fix snapshots

* Address feedback
Этот коммит содержится в:
Daniel Espino García
2024-04-22 12:42:13 +02:00
коммит произвёл GitHub
родитель 7b90b7c2e0
Коммит d0a67cd84a
82 изменённых файлов: 332 добавлений и 206 удалений

Просмотреть файл

@@ -63,7 +63,7 @@ function focusReplyPost(post: Post, channel: Channel, teamId: string, returnTo:
const team = getTeam(state, channel.team_id || teamId);
const currentChannel = getCurrentChannel(state);
const sameTeam = currentChannel && currentChannel.team_id === team.id;
const sameTeam = currentChannel && currentChannel.team_id === team?.id;
const {skipRedirectReplyPermalink} = option;
@@ -100,6 +100,9 @@ export function focusPost(postId: string, returnTo = '', currentUserId: string,
const state = getState();
const currentTeam = getCurrentTeam(state);
if (!currentTeam) {
return;
}
if (!postInfo.has_joined_channel) {
// Prompt system admin before joining the private channel