Skip to content

Commit

Permalink
✨[feat]: 둘러보기 기능추가 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy-wonji committed Dec 10, 2023
1 parent fa46266 commit 13a7a6f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
5 changes: 3 additions & 2 deletions PingPong/Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ let project = Project.makeAppModule(
platform: .iOS,
product: .app,
packages: [ // packages를 추가하여 Amplify 라이브러리 추가

.package(url: "https://github.com/firebase/firebase-ios-sdk.git", .upToNextMajor(from: "10.0.0"))
],
setting: .appMainSetting,
dependencies: [

// .package(product: "FirebaseMessaging"),
// .package(product: "FirebaseMessaging", type: .plugin),
.package(product: "FirebaseMessaging", type: .plugin),

.SPM.FirebaseMessaging,
.feature(implements: .OnBoarding)
Expand Down
20 changes: 17 additions & 3 deletions PingPong/Projects/App/Sources/Application/PingPongApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Search
import Profile
import DesignSystem
import Model
import API

@main
struct PingPongProjectApp: App {
Expand All @@ -36,7 +37,11 @@ struct PingPongProjectApp: App {
.environmentObject(sheetManager)
.navigationBarHidden(true)
.onAppear {
authViewModel.getRefreshToken()
if commonViewViewModel.isLoginCheck {
authViewModel.getRefreshToken()
} else {
APIHeaderManger.shared.firebaseUid = ""
}
}

} else if commonViewViewModel.isExploreApp {
Expand All @@ -45,15 +50,24 @@ struct PingPongProjectApp: App {
.environmentObject(sheetManager)
.navigationBarHidden(true)
.onAppear {
authViewModel.getRefreshToken()
if commonViewViewModel.isLoginCheck {

authViewModel.getRefreshToken()
} else {
APIHeaderManger.shared.firebaseUid = ""
}
}
}


else {
LoginView(viewModel: self.viewModel, commonViewViewModel: commonViewViewModel)
.onAppear {
authViewModel.getRefreshToken()
if commonViewViewModel.isLoginCheck {
authViewModel.getRefreshToken()
} else {
APIHeaderManger.shared.firebaseUid = ""
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public struct CoreView: View {
}
}
.onAppear {
authViewModel.getRefreshToken()
self.viewModel.setupCustomTabs()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public class HomeViewViewModel: ObservableObject {
self.homeRandomQuoteModel = list
}

public func randomQuoteRequest(userID: String, completion: @escaping () -> Void) {
public func randomQuoteRequest(userID: String?, completion: @escaping () -> Void) {
if let cancellable = homeRandomQuoteCancellable {
cancellable.cancel()
}

let provider = MoyaProvider<HomeService>(plugins: [MoyaLoggingPlugin()])
homeRandomQuoteCancellable = provider.requestWithProgressPublisher(.homeRandomQuote(page: currentPage, sizePerPage: 100, userId: userID))
homeRandomQuoteCancellable = provider.requestWithProgressPublisher(.homeRandomQuote(page: currentPage, sizePerPage: 100, userId: (((userID?.isEmpty) != nil) ? "" : userID) ?? ""))
.compactMap { $0.response?.data }
.receive(on: DispatchQueue.main)
.decode(type: HomeRandomQuoteModel.self, decoder: JSONDecoder())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public struct LoginView: View {
.stroke(Color.primaryOrange, style: .init(lineWidth: 2))
.frame(height: 56)
.overlay {
Text("둘라보기")
Text("둘러보기")
.foregroundStyle(Color.primaryOrangeText)
.pretendardFont(family: .SemiBold, size: 16)
}
Expand Down

0 comments on commit 13a7a6f

Please sign in to comment.