Commit 433a289d authored by Vladislav Bashkirev's avatar Vladislav Bashkirev

Fix missing context for Array.prototype.includes

parent 075297d3
......@@ -64,7 +64,16 @@ class Pin {
logging.info(`Found ${hashes.length} attachments
and ${refs.length} local objects`);
return hashes.filter(refs.includes);
// if nothing is pinned
if (!refs.length)
return hashes;
// if no hashes is found no need to filter
if (!hashes.length)
return []
// filter pinned attachments from an array of hashes
return hashes.filter(Array.prototype.includes.bind(refs));
}).catch((error) => {
throw error;
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment