mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
tutorial: Remove is_running and defer logic.
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user