Fix statuses not rendering until a change in the LHS
Этот коммит содержится в:
@@ -96,7 +96,7 @@ export default class Sidebar extends React.Component {
|
|||||||
let directChannel = channels.find(Utils.isDirectChannelForUser.bind(null, teammateId));
|
let directChannel = channels.find(Utils.isDirectChannelForUser.bind(null, teammateId));
|
||||||
|
|
||||||
// a direct channel doesn't exist yet so create a fake one
|
// a direct channel doesn't exist yet so create a fake one
|
||||||
if (!directChannel) {
|
if (directChannel == null) {
|
||||||
directChannel = {
|
directChannel = {
|
||||||
name: Utils.getDirectChannelName(currentUserId, teammateId),
|
name: Utils.getDirectChannelName(currentUserId, teammateId),
|
||||||
last_post_at: 0,
|
last_post_at: 0,
|
||||||
@@ -104,6 +104,8 @@ export default class Sidebar extends React.Component {
|
|||||||
type: Constants.DM_CHANNEL,
|
type: Constants.DM_CHANNEL,
|
||||||
fake: true
|
fake: true
|
||||||
};
|
};
|
||||||
|
} else {
|
||||||
|
directChannel = JSON.parse(JSON.stringify(directChannel));
|
||||||
}
|
}
|
||||||
|
|
||||||
directChannel.display_name = Utils.displayUsername(teammateId);
|
directChannel.display_name = Utils.displayUsername(teammateId);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import * as client from './client.jsx';
|
|||||||
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
|
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
|
||||||
import BrowserStore from '../stores/browser_store.jsx';
|
import BrowserStore from '../stores/browser_store.jsx';
|
||||||
import ChannelStore from '../stores/channel_store.jsx';
|
import ChannelStore from '../stores/channel_store.jsx';
|
||||||
|
import PreferenceStore from '../stores/preference_store.jsx';
|
||||||
import PostStore from '../stores/post_store.jsx';
|
import PostStore from '../stores/post_store.jsx';
|
||||||
import UserStore from '../stores/user_store.jsx';
|
import UserStore from '../stores/user_store.jsx';
|
||||||
import * as utils from './utils.jsx';
|
import * as utils from './utils.jsx';
|
||||||
@@ -661,13 +662,12 @@ export function getMe() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getStatuses() {
|
export function getStatuses() {
|
||||||
const directChannels = ChannelStore.getAll().filter((channel) => channel.type === Constants.DM_CHANNEL);
|
const preferences = PreferenceStore.getCategory(Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW);
|
||||||
|
|
||||||
const teammateIds = [];
|
const teammateIds = [];
|
||||||
for (var i = 0; i < directChannels.length; i++) {
|
for (const preference of preferences) {
|
||||||
const teammate = utils.getDirectTeammate(directChannels[i].id);
|
if (preference.value === 'true') {
|
||||||
if (teammate) {
|
teammateIds.push(preference.name);
|
||||||
teammateIds.push(teammate.id);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user