diff --git a/app/initial_state.js b/app/initial_state.js index 52097725d..5680735d6 100644 --- a/app/initial_state.js +++ b/app/initial_state.js @@ -40,6 +40,7 @@ const state = { posts: { posts: {}, postsInChannel: {}, + postsInThread: {}, selectedPostId: '', currentFocusedPostId: '', }, diff --git a/app/store/middleware.js b/app/store/middleware.js index 3281d8866..ccd7e7fa8 100644 --- a/app/store/middleware.js +++ b/app/store/middleware.js @@ -105,11 +105,6 @@ function resetStateForNewVersion(action) { i18n = payload.views.i18n; } - let fetchCache = initialState.views.fetchCache; - if (payload.views.fetchCache) { - fetchCache = payload.views.fetchCache; - } - let lastTeamId = initialState.views.team.lastTeamId; if (payload.views.team && payload.views.team.lastTeamId) { lastTeamId = payload.views.team.lastTeamId; @@ -147,7 +142,6 @@ function resetStateForNewVersion(action) { drafts: channelDrafts, }, i18n, - fetchCache, team: { lastTeamId, lastChannelForTeam, @@ -190,6 +184,7 @@ function cleanupState(action, keepCurrent = false) { posts: { posts: {}, postsInChannel: {}, + postsInThread: {}, reactions: {}, openGraph: payload.entities.posts.openGraph, selectedPostId: payload.entities.posts.selectedPostId, @@ -262,6 +257,11 @@ function cleanupState(action, keepCurrent = false) { nextEntitites.files.files[fileId] = payload.entities.files.files[fileId]; }); } + + const postsInThread = payload.entities.posts.postsInThread[postId]; + if (postsInThread) { + nextEntitites.posts.postsInThread[postId] = postsInThread; + } } else { // If the post is not in the store we need to remove it from the postsInChannel const channelIds = Object.keys(nextEntitites.posts.postsInChannel); diff --git a/yarn.lock b/yarn.lock index 4c20ee6a1..5acd4b982 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4637,7 +4637,7 @@ map-visit@^1.0.0: mattermost-redux@mattermost/mattermost-redux: version "1.2.0" - resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/6725f81174fe4c8514f5217a3f05b6b0368f2642" + resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/10d691f386e1dbb7669ae549bbe81b855ef4c505" dependencies: deep-equal "1.0.1" form-data "2.3.1"