mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
fix(client): allow admins to open flag modal regardless of flag status
fixes #8078
This commit is contained in:
@@ -91,7 +91,7 @@ habitrpg.controller('ChatCtrl', ['$scope', 'Groups', 'Chat', 'User', '$http', 'A
|
|||||||
$scope.flagChatMessage = function(groupId,message) {
|
$scope.flagChatMessage = function(groupId,message) {
|
||||||
if(!message.flags) message.flags = {};
|
if(!message.flags) message.flags = {};
|
||||||
|
|
||||||
if (message.flags[User.user._id]) {
|
if (!User.user.contributor.admin && message.flags[User.user._id]) {
|
||||||
Notification.text(window.env.t('abuseAlreadyReported'));
|
Notification.text(window.env.t('abuseAlreadyReported'));
|
||||||
} else {
|
} else {
|
||||||
$scope.abuseObject = message;
|
$scope.abuseObject = message;
|
||||||
|
|||||||
@@ -49,9 +49,11 @@ habitrpg
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.reportAbuse = function(reporter, message, groupId) {
|
$scope.reportAbuse = function(reporter, message, groupId) {
|
||||||
message.flags[reporter._id] = true;
|
|
||||||
Chat.flagChatMessage(groupId, message.id)
|
Chat.flagChatMessage(groupId, message.id)
|
||||||
.then(function(data){
|
.then(function(data){
|
||||||
|
var res = data.data.data;
|
||||||
|
message.flags = res.flags;
|
||||||
|
message.flagCount = res.flagCount;
|
||||||
Notification.text(window.env.t('abuseReported'));
|
Notification.text(window.env.t('abuseReported'));
|
||||||
$scope.$close();
|
$scope.$close();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user