fix mixpanel init

This commit is contained in:
Albert Yi
2018-10-22 16:23:51 -07:00
parent 4fe7fc8ae7
commit ae4e40aa76

View File

@@ -86,10 +86,14 @@
</script> </script>
<script> <script>
window.Danbooru.mixpanelInit( window.Danbooru.mixpanelInit(
<%= CurrentUser.id %>, <%= CurrentUser.id || "null" %>,
<%= raw session.id.to_json %>, <%= raw session.id.to_json %>,
<%= CurrentUser.opt_out_mixpanel? %>, <%= CurrentUser.opt_out_mixpanel? %>,
<%= raw({"$created" =>CurrentUser.created_at.strftime('%F %T'), "$name" => CurrentUser.name, "level" => CurrentUser.level, "upload_count" => CurrentUser.post_upload_count, "post_update_count" => CurrentUser.post_update_count, "note_update_count" => CurrentUser.note_update_count, "favorite_count" => CurrentUser.favorite_count}.to_json) %> <% if CurrentUser.is_anonymous? %>
{}
<% else %>
<%= raw({"$created" =>CurrentUser.created_at.strftime('%F %T'), "$name" => CurrentUser.name, "level" => CurrentUser.level, "upload_count" => CurrentUser.post_upload_count, "post_update_count" => CurrentUser.post_update_count, "note_update_count" => CurrentUser.note_update_count, "favorite_count" => CurrentUser.favorite_count}.to_json) %>
<% end %>
); );
</script> </script>