Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nto Dev
  • Loading branch information
Roy-wonji committed Nov 21, 2023
2 parents 82a4ec8 + 6cc469b commit bdd6f84
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public struct CoreView: View {
}

mainTabBar()
// .keyboardAdaptive()

.ignoresSafeArea(.keyboard)
}
.modal(with: sheetManager, viewModel: viewModel)
.onAppear {
Expand Down Expand Up @@ -105,8 +104,6 @@ public struct CoreView: View {
appState.isGoToProfileView = false
},
authViewModel: authViewModel)
//

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,23 @@ public struct FamousSayingDetailView: View {
.padding(EdgeInsets(top: 0, leading: 0, bottom: 26, trailing: 16))
.foregroundColor(viewModel.selectedCard.isBookrmark ? colorSet.icon : colorSet.iconBackground)
.onTapGesture {
print("??")
if viewModel.selectedCard.isBookrmark {
print("isBook", viewModel.selectedCard.likeId)
Task {
if let likeId = viewModel.selectedCard.likeId {
await viewModel.deleteLikeQuote(likeID: likeId)
viewModel.selectedCard.isBookrmark = false
print(viewModel.selectedCard.isBookrmark)
viewModel.removeLike(card: viewModel.selectedCard)
}
}
} else {
print("isNotBook")
Task {
await viewModel.quoteLikeRequest(userID: "\(authViewModel.userid)", quoteId: viewModel.selectedCard.qouteId, completion: {})
await viewModel.quoteLikeRequest(userID: "\(authViewModel.userid)", quoteId: viewModel.selectedCard.qouteId, completion: {
viewModel.selectedCard.likeId = viewModel.homeBaseModel?.data
})
viewModel.selectedCard.isBookrmark = true
viewModel.addLike(card: viewModel.selectedCard)
}
Expand All @@ -209,8 +215,6 @@ public struct FamousSayingDetailView: View {
.onChange(of: viewModel.selectedCard.isBookrmark , perform: { newValue in

homeViewModel.randomQuoteRequest(userID: "\(authViewModel.userid)") {
// 종아요일 때

for quoteContent in homeViewModel.homeRandomQuoteModel?.data?.content ?? [] {
let hashTags = viewModel.getHashtags(post: quoteContent)
viewModel.cards.append(CardInfomation(qouteId: quoteContent.quoteID ?? .zero, hashtags: hashTags, image: "", title: quoteContent.content ?? "", sources: quoteContent.author ?? "", isBookrmark: newValue, likeId: quoteContent.likeID))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public struct ExploreView: View {
}
.frame(height: UIScreen.main.bounds.height * 0.6)
}

}
}
.task {
Expand Down Expand Up @@ -99,7 +98,6 @@ public struct ExploreView: View {
}
}
})

}


Expand All @@ -119,7 +117,6 @@ public struct ExploreView: View {
.frame(width: 17, height: 17)
.padding(15)
.onTapGesture {
// viewModel.filterPostsByText()
}
}
)
Expand Down

0 comments on commit bdd6f84

Please sign in to comment.