zulip/web/src/tutorial.js
Prakhar Pratyush caedcb8b8b onboarding: Narrow new users in DMs with Welcome Bot.
Earlier, new users were narrowed to the interleaved
DMs view on the first visit.

This commit updates the behavior to narrow new users
in DMs with Welcome Bot.

Reason for the change:
It makes more sense overall as an interleaved DMs view
is a power user view and it would also prevent the
message fading banner #29076 from showing up if the
user DMs Welcome Bot right away.
2024-06-28 11:04:31 -07:00

28 lines
698 B
JavaScript

import * as channel from "./channel";
import * as message_view from "./message_view";
import {page_params} from "./page_params";
import * as people from "./people";
function set_tutorial_status(status, callback) {
return channel.post({
url: "/json/users/me/tutorial_status",
data: {status},
success: callback,
});
}
export function initialize() {
if (page_params.needs_tutorial) {
set_tutorial_status("started");
message_view.show(
[
{
operator: "dm",
operand: people.WELCOME_BOT.user_id,
},
],
{trigger: "sidebar"},
);
}
}