mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
challenges: shortcode for tag names & task tooltips
This commit is contained in:
@@ -19,19 +19,20 @@ var api = module.exports;
|
||||
*/
|
||||
var syncChalToUser = function(chal, user) {
|
||||
if (!chal || !user) return;
|
||||
chal.shortName = chal.shortName || chal.name;
|
||||
|
||||
// Sync tags
|
||||
var tags = user.tags || [];
|
||||
var i = _.findIndex(tags, {id: chal._id})
|
||||
if (~i) {
|
||||
if (tags[i].name !== chal.name) {
|
||||
if (tags[i].name !== chal.shortName) {
|
||||
// update the name - it's been changed since
|
||||
user.tags[i].name = chal.name;
|
||||
user.tags[i].name = chal.shortName;
|
||||
}
|
||||
} else {
|
||||
user.tags.push({
|
||||
id: chal._id,
|
||||
name: chal.name,
|
||||
name: chal.shortName,
|
||||
challenge: true
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user