mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-27 07:34:43 +02:00
Fix filter issue, cause by empty attributes
This commit is contained in:
parent
9e44dc8160
commit
581c60f41a
@ -56,10 +56,14 @@ export default {
|
|||||||
},
|
},
|
||||||
filterTiles(allTiles) {
|
filterTiles(allTiles) {
|
||||||
return allTiles.filter((tile) => {
|
return allTiles.filter((tile) => {
|
||||||
|
const {
|
||||||
|
title, description, provider, url,
|
||||||
|
} = tile;
|
||||||
const searchTerm = this.searchTile.toLowerCase();
|
const searchTerm = this.searchTile.toLowerCase();
|
||||||
return tile.title.toLowerCase().includes(searchTerm)
|
return (title && title.toLowerCase().includes(searchTerm))
|
||||||
|| tile.provider.toLowerCase().includes(searchTerm)
|
|| (provider && provider.toLowerCase().includes(searchTerm))
|
||||||
|| this.getDomainFromUrl(tile.url).includes(searchTerm);
|
|| (description && description.toLowerCase().includes(searchTerm))
|
||||||
|
|| this.getDomainFromUrl(url).includes(searchTerm);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user