Browse Source

refactor: improve filtering logic to exclude null values in DuaComponent

master
sina_sajjadi 2 weeks ago
parent
commit
d8daecb08d
  1. 5
      src/pages/duas/[slug].tsx

5
src/pages/duas/[slug].tsx

@ -281,9 +281,8 @@ console.log(data);
<div className="p-6">
{duaParts
.filter(
(item, index, self) =>
// Check if the current item's id is not already in the array
self.findIndex((i) => i.id === item.id) === index
(item, index, self) =>(
self.findIndex((i) => i.id === item.id) === index && (item.text !== null && item.local_alpha !== null && item.translation !== null))
)
.map((item, index) => (
<div

Loading…
Cancel
Save