Added fix to solve the id TypeError (#19810)
Co-authored-by: amrit <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Tushar Bhatt <[email protected]>
This commit is contained in:
1 file changed
+3
-1
@@ -173,9 +173,11 @@ function Tips() {
|
||||
const items = localStorage.getItem("removedTipsIds") || "";
|
||||
const itemToRemoveIndex = currentItems.findIndex((item) => item.id === id);
|
||||
|
||||
if (itemToRemoveIndex === -1) return [...currentItems];
|
||||
|
||||
localStorage.setItem(
|
||||
"removedTipsIds",
|
||||
`${currentItems[itemToRemoveIndex].id.toString()}${items.length > 0 ? `,${items.split(",")}` : ""}`
|
||||
`${currentItems[itemToRemoveIndex].id.toString()}${items.length > 0 ? `,${items}` : ""}`
|
||||
);
|
||||
currentItems.splice(itemToRemoveIndex, 1);
|
||||
return [...currentItems];
|
||||
|
||||
Reference in new issue
Block a user