mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-5044 Fix unread team messages for deleted channels (#4836)
This commit is contained in:
@@ -599,7 +599,7 @@ func (s SqlTeamStore) GetTeamsUnreadForUser(teamId, userId string) StoreChannel
|
||||
Channels,
|
||||
ChannelMembers
|
||||
WHERE
|
||||
Channels.Id = ChannelMembers.ChannelId AND
|
||||
Channels.Id = ChannelMembers.ChannelId AND Channels.DeleteAt = 0 AND
|
||||
ChannelMembers.UserId = :UserId AND Channels.TeamId != :TeamId
|
||||
GROUP BY
|
||||
Channels.TeamId`, map[string]interface{}{"UserId": userId, "TeamId": teamId})
|
||||
|
||||
@@ -70,37 +70,40 @@ function preNeedsTeam(nextState, replace, callback) {
|
||||
browserHistory.push('/');
|
||||
return;
|
||||
}
|
||||
if (nextState.location.pathname.indexOf('/channels/') > -1) {
|
||||
GlobalActions.emitCloseRightHandSide();
|
||||
|
||||
GlobalActions.emitCloseRightHandSide();
|
||||
TeamStore.saveMyTeam(team);
|
||||
TeamStore.emitChange();
|
||||
loadProfilesAndTeamMembersForDMSidebar();
|
||||
AsyncClient.getMyTeamsUnread();
|
||||
AsyncClient.getMyChannelMembers();
|
||||
|
||||
TeamStore.saveMyTeam(team);
|
||||
TeamStore.emitChange();
|
||||
loadProfilesAndTeamMembersForDMSidebar();
|
||||
AsyncClient.getMyTeamsUnread();
|
||||
AsyncClient.getMyChannelMembers();
|
||||
const d1 = $.Deferred(); //eslint-disable-line new-cap
|
||||
|
||||
const d1 = $.Deferred(); //eslint-disable-line new-cap
|
||||
Client.getChannels(
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_CHANNELS,
|
||||
channels: data
|
||||
});
|
||||
|
||||
Client.getChannels(
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_CHANNELS,
|
||||
channels: data
|
||||
});
|
||||
loadStatusesForChannelAndSidebar();
|
||||
|
||||
loadStatusesForChannelAndSidebar();
|
||||
d1.resolve();
|
||||
},
|
||||
(err) => {
|
||||
AsyncClient.dispatchError(err, 'getChannels');
|
||||
d1.resolve();
|
||||
}
|
||||
);
|
||||
|
||||
d1.resolve();
|
||||
},
|
||||
(err) => {
|
||||
AsyncClient.dispatchError(err, 'getChannels');
|
||||
d1.resolve();
|
||||
}
|
||||
);
|
||||
|
||||
$.when(d1).done(() => {
|
||||
$.when(d1).done(() => {
|
||||
callback();
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function selectLastChannel(nextState, replace, callback) {
|
||||
|
||||
Reference in New Issue
Block a user