[schema][manual] Automatically subscribe users to default streams only after tutorial

(imported from commit 6511851c0aee2628bef597bf1310d6f96b0fd1d4)
This commit is contained in:
Leo Franchi
2013-04-04 16:30:28 -04:00
parent 7ce6154464
commit 8fe82085c4
9 changed files with 505 additions and 61 deletions

View File

@@ -240,6 +240,13 @@ exports.start = function () {
tutorial_running = true;
add_to_tutorial_stream();
run_tutorial(0);
$.ajax({
type: 'POST',
url: '/json/tutorial_status',
data: {status: 'started'}
});
};
// This technique is not actually that awesome, because it's pretty
@@ -256,6 +263,17 @@ exports.stop = function () {
if (tutorial_running) {
subs.tutorial_unsubscribe_me_from(my_tutorial_stream);
tutorial_running = false;
$.ajax({
type: 'POST',
url: '/json/tutorial_status',
data: {status: 'finished'},
success: function () {
// We need to reload the streams list so the sidebar is populated
// with the new streams
subs.reload_subscriptions({clear_first: true});
}
});
}
};