From bd228d5ee7442228c8b84d2076bfc006ccbe789f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 1 Jul 2020 22:56:18 -0400 Subject: [PATCH] feat: fix blocksCount not being returned on user profile add hook action:user.blocks.toggle --- public/src/client/account/blocks.js | 1 + src/user/data.js | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/src/client/account/blocks.js b/public/src/client/account/blocks.js index a6dd7978cd..3e76ceb620 100644 --- a/public/src/client/account/blocks.js +++ b/public/src/client/account/blocks.js @@ -50,6 +50,7 @@ define('forum/account/blocks', ['forum/account/header'], function (header) { $('#users-container').html(html); $('#users-container').siblings('div.alert')[html.length ? 'hide' : 'show'](); }); + $(window).trigger('action:user.blocks.toggle', { data: payload }); }) .fail(function () { ajaxify.go(ajaxify.currentPage); diff --git a/src/user/data.js b/src/user/data.js index 400d8ef472..ef48266b17 100644 --- a/src/user/data.js +++ b/src/user/data.js @@ -11,8 +11,9 @@ const utils = require('../utils'); const intFields = [ 'uid', 'postcount', 'topiccount', 'reputation', 'profileviews', - 'banned', 'banned:expire', 'email:confirmed', 'joindate', 'lastonline', 'lastqueuetime', - 'lastposttime', 'followingCount', 'followerCount', 'passwordExpiry', + 'banned', 'banned:expire', 'email:confirmed', 'joindate', 'lastonline', + 'lastqueuetime', 'lastposttime', 'followingCount', 'followerCount', + 'blocksCount', 'passwordExpiry', ]; module.exports = function (User) { @@ -27,8 +28,8 @@ module.exports = function (User) { 'lastonline', 'picture', 'fullname', 'location', 'birthday', 'website', 'aboutme', 'signature', 'uploadedpicture', 'profileviews', 'reputation', 'postcount', 'topiccount', 'lastposttime', 'banned', 'banned:expire', - 'status', 'flags', 'followerCount', 'followingCount', 'cover:url', - 'cover:position', 'groupTitle', + 'status', 'flags', 'followerCount', 'followingCount', 'blocksCount', + 'cover:url', 'cover:position', 'groupTitle', ]; User.guestData = {