Skip to content

Commit

Permalink
Feat: 요약하는 동안 다른 인터랙션 가능하록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
TaePoong719 committed Oct 17, 2023
1 parent bea13ce commit 1b03a27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ const Card = ({ userCards, setUserCards, setIsModalOpen, setLoading }) => {
const pdfRef = ref(storage, `pdf/${getCurrentDate()}`)
const snapshot = await uploadBytes(pdfRef, pdfFile)
const url = await getDownloadURL(snapshot.ref)
navigate('/home')
setLoading(false)
alert('현재 AI가 요약중입니다. 요약이 끝나 카드가 완성되면 알려드리겠습니다.')
const summary = await axios.post('/api/904/summary_pdf', {
url: url,
})
Expand Down Expand Up @@ -133,9 +136,9 @@ const Card = ({ userCards, setUserCards, setIsModalOpen, setLoading }) => {
const updatedCards = [...userCards, { ...updatedCard, cardId: resCard.data.result }]
console.log({ ...updatedCard, cardId: resCard.data.result })
setUserCards(updatedCards)
navigate('/home')
alert('요약이 성공적으로 이뤄졌습니다.')
} catch (e) {
console.log(e)
alert(e)
} finally {
setLoading(false)
}
Expand Down

0 comments on commit 1b03a27

Please sign in to comment.