mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Mods blocking (#8364)
* updated logic for blocking/unblocking * updated 1 test and added 2
This commit is contained in:
committed by
Keith Holliday
parent
07ce68c596
commit
dbb1e3aa18
@@ -177,10 +177,13 @@ api.updateHero = {
|
||||
_.set(hero, updateData.itemPath, updateData.itemVal); // Sanitization at 5c30944 (deemed unnecessary)
|
||||
}
|
||||
|
||||
if (updateData.auth && _.isBoolean(updateData.auth.blocked)) {
|
||||
if (updateData.auth && updateData.auth.blocked === true) {
|
||||
hero.auth.blocked = updateData.auth.blocked;
|
||||
hero.preferences.sleep = true; // when blocking, have them rest at an inn to prevent damage
|
||||
}
|
||||
if (updateData.auth && updateData.auth.blocked === false) {
|
||||
hero.auth.blocked = false;
|
||||
}
|
||||
if (updateData.flags && _.isBoolean(updateData.flags.chatRevoked)) hero.flags.chatRevoked = updateData.flags.chatRevoked;
|
||||
|
||||
let savedHero = await hero.save();
|
||||
|
||||
Reference in New Issue
Block a user