update local storage recentlyViewed Items
This commit is contained in:
@@ -121,6 +121,14 @@ export default function RecentlyViewed({ title, panelInfo, isOnTop }) {
|
||||
return;
|
||||
}
|
||||
|
||||
const updatedRecentItems = localRecentItems.filter((item) => {
|
||||
const id = item.prdtId || item.showId;
|
||||
|
||||
return !selectedItems[id];
|
||||
});
|
||||
|
||||
dispatch(changeLocalSettings({ recentItems: updatedRecentItems }));
|
||||
|
||||
const updatedRecentlyDatas = recentlyDatas.reduce((acc, data) => {
|
||||
const updatedProductInfos = data.productInfos.filter((item) => {
|
||||
const id = item.prdtId || item.showId;
|
||||
@@ -137,14 +145,6 @@ export default function RecentlyViewed({ title, panelInfo, isOnTop }) {
|
||||
|
||||
setRecentlyDatas(updatedRecentlyDatas);
|
||||
|
||||
recentItems = recentItems.filter((item) => {
|
||||
const id = item.prdtId || item.showId;
|
||||
|
||||
return !selectedItems[id];
|
||||
});
|
||||
|
||||
dispatch(changeLocalSettings({ recentItems }));
|
||||
|
||||
const deletedCount = Object.values(selectedItems).filter(Boolean).length;
|
||||
|
||||
if (deletedCount > 0) {
|
||||
|
||||
Reference in New Issue
Block a user