[DetailPanel]

- savToLocalStorage 로직 수정 : recentItmes 에 expireTime 추가
This commit is contained in:
jiwon93.son
2024-04-16 00:24:32 +09:00
parent b980f641e5
commit b622d7b083

View File

@@ -99,6 +99,7 @@ export default function ItemDetail() {
}, [dispatch]);
const saveToLocalStorage = useCallback(() => {
// recentlyViewed localstorage
const recentItmes =
JSON.parse(window.localStorage.getItem("recentItems")) || [];
@@ -120,6 +121,7 @@ export default function ItemDetail() {
prdtId: selectedPrdtId,
patnrId: selectedPatnrId,
date: formattedDate,
expireTime: currentDate.getTime() + 1000 * 60 * 60 * 24 * 14,
cntryCd: httpHeader["X-Device-Country"],
});