mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 17:26:25 +02:00
feat(users): show user h&r warning numbers in header menu and user info page
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
.controller('HeaderController', HeaderController);
|
||||
|
||||
HeaderController.$inject = ['$scope', '$state', '$stateParams', '$translate', 'Authentication', 'menuService', 'MeanTorrentConfig', 'localStorageService',
|
||||
'ScoreLevelService', 'InvitationsService', '$interval', 'MessagesService', 'TorrentsService'];
|
||||
'ScoreLevelService', 'InvitationsService', '$interval', 'MessagesService', 'TorrentsService', 'UsersService'];
|
||||
|
||||
function HeaderController($scope, $state, $stateParams, $translate, Authentication, menuService, MeanTorrentConfig, localStorageService, ScoreLevelService,
|
||||
InvitationsService, $interval, MessagesService, TorrentsService) {
|
||||
InvitationsService, $interval, MessagesService, TorrentsService, UsersService) {
|
||||
var vm = this;
|
||||
vm.user = Authentication.user;
|
||||
vm.language = MeanTorrentConfig.meanTorrentConfig.language;
|
||||
@@ -68,6 +68,7 @@
|
||||
* checkMessageUnread
|
||||
*/
|
||||
vm.checkMessageUnread = function () {
|
||||
vm.getCountUnread();
|
||||
$interval(vm.getCountUnread, 120000);
|
||||
};
|
||||
|
||||
@@ -79,6 +80,23 @@
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* checkHnRWarning
|
||||
*/
|
||||
vm.checkHnRWarning = function () {
|
||||
vm.getWarning();
|
||||
$interval(vm.getWarning, 120000);
|
||||
};
|
||||
|
||||
vm.getWarning = function () {
|
||||
if (Authentication.user) {
|
||||
UsersService.getUserWarningNumber()
|
||||
.then(function (data) {
|
||||
vm.user.hnr_warning = Authentication.user.hnr_warning = data.hnr_warning;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* stateChangeSuccess
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user