Skip to content

Commit

Permalink
fix: 상세 이미지 로컬 스토리지 클라이언트 접근 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mintmin0320 committed Mar 29, 2024
1 parent bb2b1f9 commit 85148af
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

import { LocalStorage } from '@/app/_utils/localStorage'
import Image from 'next/image'
import { useEffect, useMemo, useState } from 'react'
import { useEffect, useState } from 'react'

export default function DetailImage() {
const imageUrls = useMemo(() => LocalStorage.imageUrls().getter(), [])
const [imageUrls, setImageUrls] = useState<string[]>([])

useEffect(() => {
const storedImageUrls = LocalStorage.imageUrls().getter() || []
setImageUrls(storedImageUrls)
}, [])

const [selectedImageUrl, setSelectedImageUrl] = useState<string>(
imageUrls[0] || '/image/icon/icon-close.svg',
Expand Down

0 comments on commit 85148af

Please sign in to comment.