mirror of
https://github.com/simple-login/app.git
synced 2025-02-24 07:43:54 +08:00
Make sure to show intro to user only once
This commit is contained in:
parent
dee6d4959d
commit
3d10fab3a6
2 changed files with 12 additions and 5 deletions
|
@ -346,15 +346,12 @@
|
|||
<script>
|
||||
var clipboard = new ClipboardJS('.clipboard');
|
||||
|
||||
var introShown = store.get("introShown");
|
||||
if ("yes" !== introShown) {
|
||||
{% if show_intro %}
|
||||
// only show intro when screen is big enough to show "developer" tab
|
||||
if (window.innerWidth >= 1024) {
|
||||
introJs().start();
|
||||
store.set("introShown", "yes")
|
||||
}
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
|
||||
$(".delete-email").on("click", function (e) {
|
||||
let alias = $(this).parent().find(".alias").val();
|
||||
|
|
|
@ -175,6 +175,15 @@ def index():
|
|||
|
||||
mailboxes = current_user.mailboxes()
|
||||
|
||||
show_intro = False
|
||||
if not current_user.intro_shown:
|
||||
LOG.d("Show intro to %s", current_user)
|
||||
show_intro = True
|
||||
|
||||
# to make sure not showing intro to user again
|
||||
current_user.intro_shown = True
|
||||
db.session.commit()
|
||||
|
||||
return render_template(
|
||||
"dashboard/index.html",
|
||||
client_users=client_users,
|
||||
|
@ -183,6 +192,7 @@ def index():
|
|||
query=query,
|
||||
AliasGeneratorEnum=AliasGeneratorEnum,
|
||||
mailboxes=mailboxes,
|
||||
show_intro=show_intro,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue