diff --git a/static/css/styles.css b/static/css/styles.css index 161f7d1..3aa8dd0 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -789,6 +789,7 @@ section.profile { .selected{ background: #FF613A !important; + transition: background 200ms cubic-bezier(1, -0.16, 0, 1.14) } .selected>a{ diff --git a/static/js/check_new_messages.js b/static/js/check_new_messages.js index 17b29b6..79f23fc 100644 --- a/static/js/check_new_messages.js +++ b/static/js/check_new_messages.js @@ -21,7 +21,7 @@ function check_new_messages_timeout(){ } check_msg = setInterval(function () { // let new_message = getNewMessageSession() - let user_online = userOnline('set') + // let user_online = userOnline('set') window = document.querySelector(".container-messages") if (window === null){ // @@ -30,7 +30,7 @@ function check_new_messages_timeout(){ check_new_messages(window,it) } }, - 10000) + 1000) } diff --git a/static/js/global_js.js b/static/js/global_js.js index abf8c58..d85c2ce 100644 --- a/static/js/global_js.js +++ b/static/js/global_js.js @@ -3,9 +3,30 @@ $(document).ready(function (){ }) function getNewMessageSession (){ - let new_message = JSON.parse( - sessionStorage.getItem('user_alerts') - ) - return new_message -} + var o = document.cookie.split("; "); + var r = [{}]; + for(var i = 0;i < o.length;i++){ + r[o[i].split("=")[0]] = o[i].split("=")[1]; + } + let prs_ = null + if (r['user_alerts'] !== null || r['user_alerts']){ + let prs = JSON.parse(r['user_alerts']) + prs_ = JSON.parse(prs) + } else { + // + } + // if (prs === "{'new_message': True}"){ + // prs = { + // 'new_message' : 'True' + // } + // } else { + // prs = { + // 'new_message' : 'False' + // } + // } + // b = cookieS + // let b = CookieStore.getAll() + return prs_; + +}