-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] Automatically select the first channel #7350
[NEW] Automatically select the first channel #7350
Conversation
@@ -73,6 +73,15 @@ Template.roomList.helpers({ | |||
} | |||
}); | |||
|
|||
Template.roomList.rendered = function() { | |||
if (this.data.identifier !== undefined && this.data.identifier === 'c') { |
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 needs to be optional. Not everyone wants this. Some want to make use of the home page to show off news and other items. Also perhaps it could let an admin choose to either take them to a specific channel, or the first channel in the list.
if (this.data.identifier !== undefined && this.data.identifier === 'c') { | ||
const _first_child = this.find('.channelItemLists').children[0]; | ||
if (_first_child !== '' && _first_child !== undefined) { | ||
_first_child.children[0].click(); |
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.
Please look at room manager to open channels. The DOM elements here are going to change. If this class goes away the functionality breaks. This kind of thing would be ok for a user to add in custom javascript. But for including in our code... We wouldn't be able to accept this.
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.
So I'll add one textbox in Admin ~~ General section with label "First Channel After Login". User can provide the channel he want. If no channel is provided or invalid channel is provided then default home page will be loaded.
will this be fine?
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.
Yes, that is fine. You should remove these changes on this file
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.
Anything else needed here? If not then let me know the next step to proceed further.
So I'll add one textbox in Admin ~~ General section with label "First Channel After Login". User can provide the channel he want. If no channel is provided or invalid channel is provided then default home page will be loaded. will this be fine? |
That should do the trick. Just make sure to use RoomManager or something of that sort to do the loading of the channel. Doing things via the DOM is bound to result in things breaking. |
Looks better! @RocketChat/core what should we do if they aren't in the channel any more? Should we keep showing it? |
If the channel is not available now or a invalid one then it will show the default home screen. |
If everything is ok, please let me know I will merge the code. |
if (this.data.identifier !== undefined && this.data.identifier === 'c') { | ||
const _first_child = this.find('.channelItemLists').children[0]; | ||
if (_first_child !== '' && _first_child !== undefined) { | ||
_first_child.children[0].click(); |
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.
Yes, that is fine. You should remove these changes on this file
Ok. I will remove changes from roomList.js and roomList.html |
Removed from roomList.js |
Anyone still working on this - looks like a great (and much asked for) feature! :) |
Automatically select the first channel after login.
Issue URL:
https://www.bountysource.com/issues/44518290-enter-instantly-to-first-room-after-login
closes #6794