diff --git a/config/env/torrents.js b/config/env/torrents.js index 6dcdaa82..605078b0 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -230,6 +230,7 @@ module.exports = { * @value: messages type value list * @name: type name * @value: type value + * @checkUnreadInterval: set check unread message interval, default 2 minutes */ messages: { type: { @@ -240,7 +241,8 @@ module.exports = { {name: 'ADVERT', value: 'advert'}, {name: 'NOTICE', value: 'notice'} ] - } + }, + checkUnreadInterval: 60 * 1000 * 2 }, /** diff --git a/modules/core/client/controllers/header.client.controller.js b/modules/core/client/controllers/header.client.controller.js index bc0f7cc7..fcafe39a 100644 --- a/modules/core/client/controllers/header.client.controller.js +++ b/modules/core/client/controllers/header.client.controller.js @@ -14,6 +14,7 @@ vm.user = Authentication.user; vm.language = MeanTorrentConfig.meanTorrentConfig.language; vm.announceConfig = MeanTorrentConfig.meanTorrentConfig.announce; + vm.messageConfig = MeanTorrentConfig.meanTorrentConfig.messages; vm.appConfig = MeanTorrentConfig.meanTorrentConfig.app; vm.signConfig = MeanTorrentConfig.meanTorrentConfig.sign; vm.accountMenu = menuService.getMenu('account').items[0]; @@ -77,7 +78,7 @@ */ vm.checkMessageUnread = function () { vm.getCountUnread(); - $interval(vm.getCountUnread, 120000); + $interval(vm.getCountUnread, vm.messageConfig.checkUnreadInterval); }; vm.getCountUnread = function () {