tutorial: Remove is_running and defer logic.

This commit is contained in:
Rishi Gupta
2017-07-17 13:43:01 -07:00
committed by Tim Abbott
parent 99df794f2c
commit 0286a41c4c
5 changed files with 3 additions and 52 deletions

View File

@@ -1,9 +1,7 @@
var tutorial = (function () {
var exports = {};
var is_running = false;
var event_handlers = {};
var deferred_work = [];
// We'll temporarily set stream colors for the streams we use in the demo
// tutorial messages.
@@ -37,14 +35,6 @@ function set_tutorial_status(status, callback) {
});
}
exports.is_running = function () {
return is_running;
};
exports.defer = function (callback) {
deferred_work.push(callback);
};
function finale(skip) {
var finale_modal = $("#tutorial-finale");
if (skip) {
@@ -63,14 +53,9 @@ function finale(skip) {
// Restore your actual stream colors
set_tutorial_status("finished");
is_running = false;
stream_color.default_color = real_default_color;
$('#first_run_message').show();
enable_event_handlers();
_.each(deferred_work, function (callback) {
callback();
});
deferred_work = [];
var sender_bot = "welcome-bot@zulip.com";
narrow.by('pm-with', sender_bot, {select_first_unread: true, trigger: 'sidebar'});
@@ -87,7 +72,6 @@ exports.start = function () {
real_default_color = stream_color.default_color;
stream_color.default_color = tutorial_default_color;
disable_event_handlers();
is_running = true;
set_tutorial_status("started");
finale(true);
};