mirror of https://github.com/zulip/zulip.git
streams: Handle "#streams/new" url for users who cannot create streams.
We already do not show the buttons for opening the stream creation form if user is not allowed to create streams at all, but the user can still open the form by going on "#streams/new" url. This commit fixes this by redirecting such users to "#streams/subscribed" like we do for guests.
This commit is contained in:
parent
54bc960898
commit
7da8f9650c
|
@ -702,7 +702,11 @@ function show_right_section() {
|
|||
export function change_state(section, right_side_tab) {
|
||||
// if in #streams/new form.
|
||||
if (section === "new") {
|
||||
if (!current_user.is_guest) {
|
||||
const can_create_streams =
|
||||
settings_data.user_can_create_private_streams() ||
|
||||
settings_data.user_can_create_public_streams() ||
|
||||
settings_data.user_can_create_web_public_streams();
|
||||
if (can_create_streams) {
|
||||
do_open_create_stream();
|
||||
show_right_section();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue