PLT-4787 Fixed not being able to join a channel through a link after opening the More Channels modal (#4616)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0ef77dff13
Коммит
43c703e216
@@ -17,11 +17,12 @@ export default class PostViewCache extends React.Component {
|
|||||||
|
|
||||||
this.onChannelChange = this.onChannelChange.bind(this);
|
this.onChannelChange = this.onChannelChange.bind(this);
|
||||||
|
|
||||||
|
const currentChannelId = ChannelStore.getCurrentId();
|
||||||
const channel = ChannelStore.getCurrent();
|
const channel = ChannelStore.getCurrent();
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
currentChannelId: channel.id,
|
currentChannelId,
|
||||||
channels: [channel]
|
channels: channel ? [channel] : []
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ export default class PostViewCache extends React.Component {
|
|||||||
const channels = Object.assign([], this.state.channels);
|
const channels = Object.assign([], this.state.channels);
|
||||||
const currentChannel = ChannelStore.getCurrent();
|
const currentChannel = ChannelStore.getCurrent();
|
||||||
|
|
||||||
if (currentChannel == null) {
|
if (!currentChannel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,13 +29,16 @@ function doChannelChange(state, replace, callback) {
|
|||||||
channel = JSON.parse(state.location.query.fakechannel);
|
channel = JSON.parse(state.location.query.fakechannel);
|
||||||
} else {
|
} else {
|
||||||
channel = ChannelStore.getByName(state.params.channel);
|
channel = ChannelStore.getByName(state.params.channel);
|
||||||
if (!channel) {
|
|
||||||
channel = ChannelStore.getMoreByName(state.params.channel);
|
|
||||||
}
|
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
Client.joinChannelByName(
|
Client.joinChannelByName(
|
||||||
state.params.channel,
|
state.params.channel,
|
||||||
(data) => {
|
(data) => {
|
||||||
|
AppDispatcher.handleServerAction({
|
||||||
|
type: ActionTypes.RECEIVED_CHANNEL,
|
||||||
|
channel: data
|
||||||
|
});
|
||||||
|
|
||||||
GlobalActions.emitChannelClickEvent(data);
|
GlobalActions.emitChannelClickEvent(data);
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user