mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
start upgrading eslint
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
export default function isPinned (user, item, checkOfficialPinnedItems /* getOfficialPinnedItems */) {
|
||||
if (user === null)
|
||||
return false;
|
||||
if (user === null) return false;
|
||||
|
||||
const isPinnedOfficial = checkOfficialPinnedItems !== undefined && checkOfficialPinnedItems.findIndex(pinned => pinned.path === item.path) > -1;
|
||||
const isItemUnpinned = user.unpinnedItems !== undefined && user.unpinnedItems.findIndex(unpinned => unpinned.path === item.path) > -1;
|
||||
const isItemPinned = user.pinnedItems !== undefined && user.pinnedItems.findIndex(pinned => pinned.path === item.path) > -1;
|
||||
|
||||
if (isPinnedOfficial && !isItemUnpinned)
|
||||
return true;
|
||||
if (isPinnedOfficial && !isItemUnpinned) return true;
|
||||
|
||||
return isItemPinned;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user