-
Notifications
You must be signed in to change notification settings - Fork 2.7k
PLT-8508: switch channel before leaving the channel #566
Conversation
actions/channel_actions.jsx
Outdated
await ChannelActions.leaveChannel(channelId)(dispatch, getState); | ||
if (ChannelUtils.isFavoriteChannelId(channelId)) { | ||
unmarkFavorite(channelId); | ||
} | ||
|
||
const townsquare = ChannelStore.getByName('town-square'); | ||
browserHistory.push(TeamStore.getCurrentTeamRelativeUrl() + '/channels/' + townsquare.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the bit that's actually doing the channel changing. It will essentially push us through this react-router route which you can follow down the rabbit-hole starting here if you want to see what's happening. (Warning it's had a lot of organic growth and is in need of cleaning).
Anyways, point is it might work better if you moved the browserHistory.push()
to be before the ChannelActions.leaveChannel()
instead of adding the ChannelActions.selectChannel()
because the browserHistory.push()
will eventually do the channel select somewhere down the rabbit hole
Let me know if that doesn't make sense and I'll clarify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubted you, but was wrong. Great tip. It works now on localhost
@stephenkiers if this is for the 4.6 release you'll need to base this off |
Also is this waiting on another PR? Just wondering why the |
This PR redirects a user to the town square channel before unsubscribing them from the current channel.
This is now based on the branch release-4.6 |
* PLT-8496 Fix shift+Up to open reply RHS (#554) * Fix shift+Up to open reply RHS * Feedback review * Remove unsued vars * Fix FF in mobile view (#559) * Fix FF in mobile view * show error in console when changeCss fails * Fix hover and unmounting issues with post_info (#562) * Release 4.6 (#567) * PLT-8507 - Reply icon not inline in firefox * PLT-8504 - Scroll bar cutting of File thumbnails * Fix many places where components error when missing props (#571) * Based on release-4.6 (#566) This PR redirects a user to the town square channel before unsubscribing them from the current channel. * RN-8502 Show errors on Join Another Team page (#563) * fix incorrect channel notification settings when switching teams and reset active section whenever channel notification modal is closed or hidden (#560) * [PLT-8424] Do not show add-user-to-channel ephemeral message at center (#533) * do not show add-user-to-channel ephemeral message at center * send add to channel ephemeral post via client app * PLT-8510: Feature checks for older webkit support of Performance API. (#557) * PLT-8510: Feature checks for older webkit support of Performance API. * PLT-8510: Added global performance object for tests. * Fixed autoFocus issue with delete modal after edit (#572) * Fixed autoFocus issue with delete modal after edit * check style fixes * conditional check * update copyTheme string on handleColorChange (#580) * PLT-8335 fixing issue with iOS classic (#579) * PLT-8335 fixing issue with iOS classic * Fixing eslint errors * PLT-8522 Added clientside rendering for removed from team messages (#576) * PLT-8522 Added clientside rendering for removed from team messages * Fixed extra quotation mark * PLT-8521 - Fixing overlay on sidebar (#581) * Fix merge
* PLT-8496 Fix shift+Up to open reply RHS (#554) * Fix shift+Up to open reply RHS * Feedback review * Remove unsued vars * Fix FF in mobile view (#559) * Fix FF in mobile view * show error in console when changeCss fails * Fix hover and unmounting issues with post_info (#562) * Release 4.6 (#567) * PLT-8507 - Reply icon not inline in firefox * PLT-8504 - Scroll bar cutting of File thumbnails * Fix many places where components error when missing props (#571) * Based on release-4.6 (#566) This PR redirects a user to the town square channel before unsubscribing them from the current channel. * RN-8502 Show errors on Join Another Team page (#563) * fix incorrect channel notification settings when switching teams and reset active section whenever channel notification modal is closed or hidden (#560) * [PLT-8424] Do not show add-user-to-channel ephemeral message at center (#533) * do not show add-user-to-channel ephemeral message at center * send add to channel ephemeral post via client app * PLT-8510: Feature checks for older webkit support of Performance API. (#557) * PLT-8510: Feature checks for older webkit support of Performance API. * PLT-8510: Added global performance object for tests. * Fixed autoFocus issue with delete modal after edit (#572) * Fixed autoFocus issue with delete modal after edit * check style fixes * conditional check * update copyTheme string on handleColorChange (#580) * PLT-8335 fixing issue with iOS classic (#579) * PLT-8335 fixing issue with iOS classic * Fixing eslint errors * PLT-8522 Added clientside rendering for removed from team messages (#576) * PLT-8522 Added clientside rendering for removed from team messages * Fixed extra quotation mark * PLT-8521 - Fixing overlay on sidebar (#581) * Fixed next button display logic (#586) (cherry picked from commit 2b5ef33) * PLT-8539: Fix flagged post attachment regression (#587) * fix flagged post attachments * update snapshots * PLT-8534 added check to ensure that draft message is blank before doing anything (#590) * added check to ensure that draft message is blank before doing anything * refactored code to be more readable and easier to follow * refactored a little more refactored ctrlEnterKey combo and removed Up from ctrlKeyCombo var name * PLT-8527 Fix error bar and bad connection state for textbox (#588) * Correctly reset error connection count * Force clear errors in announcement bar constructor * PLT-8533 Fixed username autocomplete not working with mixed cases (#595) * [PLT-8536] Call PostActions.createPost wrapper function instead of createPost from mattermost-redux (#592) * call PostActions.createPost wrapper function instead of createPost from mattermost-redux * revert GlobalActions.postListScrollChange(true) and remove unused createPost props * PLT-8554 - Updating reply arrow issue (#596) * PLT-8517: Fix for scrolling reply textarea into view when obstructed by mobile keyboard. (#594)
Summary
This PR redirects a user to the town square channel before unsubscribing them from the current channel.
Ticket Link
https://mattermost.atlassian.net/browse/PLT-8508
mattermost/mattermost#8053
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
make check-style
to check for style errors (required for all pull requests)make test
to ensure unit and component tests passed