Files
zulip/static/js/tutorial.js
Rishi Gupta 51bc7801dd tutorial: Narrow to /is/private instead of pm-with welcome-bot.
Main reasons:
* Shouldn't be hardcoding welcome bot

* compose_actions.cancel() was not closing the compose box, for some
  reason. It was working fine before commit a few up from here ("tutorial:
  Remove rest of tutorial."), but I think possibly due to the fact that one
  had to click a button to exit the tutorial (that could be wrong, it was
  hard to pinpoint why it was working before that commit and not after.)

This code should be going away anyway once #5816 is resolved.
2017-08-01 22:38:22 -07:00

33 lines
648 B
JavaScript

var tutorial = (function () {
var exports = {};
function set_tutorial_status(status, callback) {
return channel.post({
url: '/json/tutorial_status',
data: {status: JSON.stringify(status)},
success: callback,
});
}
function finale() {
set_tutorial_status("finished");
narrow.by('is', 'private', {select_first_unread: true, trigger: 'sidebar'});
}
exports.start = function () {
finale();
};
exports.initialize = function () {
if (page_params.needs_tutorial) {
exports.start();
}
};
return exports;
}());
if (typeof module !== 'undefined') {
module.exports = tutorial;
}