Browse Source

[FIX] correct using of "working" property

experimental
Georgi Hristov 3 years ago
parent
commit
17e4c1ae5b
2 changed files with 6 additions and 3 deletions
  1. +3
    -3
      modules/Base/Notify/js/main.js
  2. +3
    -0
      modules/Base/Notify/refresh.php

+ 3
- 3
modules/Base/Notify/js/main.js View File

@@ -21,11 +21,11 @@ var Base_Notify = {
refresh: function () {
if (!this.is_active()) return;

if(this.working) return;
this.working = 1;
if(Base_Notify.working) return;
Base_Notify.working = 1;

jq.getJSON('modules/Base/Notify/refresh.php', function(json){
this.working = 0;
Base_Notify.working = 0;

if (typeof json === 'undefined' || jq.isEmptyObject(json)) return;
if (typeof json.disable !== 'undefined') {


+ 3
- 0
modules/Base/Notify/refresh.php View File

@@ -14,6 +14,7 @@ define('READ_ONLY_SESSION', true);
require_once('../../../include.php');
ModuleManager::load_modules();

ob_start();
$token = Base_NotifyCommon::get_session_token(); // will check is user logged

if ($token === false) {
@@ -72,6 +73,8 @@ foreach ($notifications as $module => $module_new_notifications) {

Base_NotifyCommon::set_notified_cache($notified_cache, $token, $all_notified ? $refresh_time : Base_NotifyCommon::get_last_refresh($token));

ob_end_clean();

if (count($ret)) {
echo json_encode(array('messages' => $ret));
}


Loading…
Cancel
Save