2021-02-28 00:39:51 +01:00
|
|
|
import * as channel from "./channel";
|
2021-02-28 21:31:57 +01:00
|
|
|
import * as narrow from "./narrow";
|
2021-03-25 22:35:45 +01:00
|
|
|
import {page_params} from "./page_params";
|
2021-02-28 00:39:51 +01:00
|
|
|
|
2013-04-12 21:33:00 +02:00
|
|
|
function set_tutorial_status(status, callback) {
|
2013-12-18 19:55:18 +01:00
|
|
|
return channel.post({
|
2020-07-15 01:29:15 +02:00
|
|
|
url: "/json/users/me/tutorial_status",
|
2021-05-04 16:59:17 +02:00
|
|
|
data: {status},
|
2018-12-18 19:34:45 +01:00
|
|
|
success: callback,
|
2013-04-12 21:33:00 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-02-10 17:04:41 +01:00
|
|
|
export function initialize() {
|
2013-03-25 23:26:14 +01:00
|
|
|
if (page_params.needs_tutorial) {
|
2017-08-31 18:20:03 +02:00
|
|
|
set_tutorial_status("started");
|
2020-07-15 01:29:15 +02:00
|
|
|
narrow.by("is", "private", {trigger: "sidebar"});
|
2013-02-13 22:15:13 +01:00
|
|
|
}
|
2021-02-10 17:04:41 +01:00
|
|
|
}
|