Skip to content

Commit

Permalink
Merge pull request #123 from DeveloperAcademy-POSTECH/feat/#122
Browse files Browse the repository at this point in the history
[fix] 자잘한 버그 수정
  • Loading branch information
InKyungLee authored Nov 29, 2024
2 parents cba7750 + 2339d55 commit 52ed492
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 27 deletions.
4 changes: 2 additions & 2 deletions AsyncC/Source/Data/Repositories/FirebaseRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ final class FirebaseRepository: FirebaseRepositoryProtocol
if let error = error {
print("Failed to send syncRequest: \(error.localizedDescription)")
} else {
print("Emoticon successfully sent!")
print("Sync successfully sent!")
}
}
}
Expand Down Expand Up @@ -219,7 +219,7 @@ final class FirebaseRepository: FirebaseRepositoryProtocol
func setupListenerForSyncRequest(userID: String, handler: @escaping (Result<SyncRequest, Error>) -> Void) {
let db = Firestore.firestore()
let docRef = db.collection("syncRequests").document(userID)
print("created listener for emoticons")
print("created listener for syncRequests")

if syncRequestListener != nil {return}

Expand Down
4 changes: 2 additions & 2 deletions AsyncC/Source/Domain/UseCases/SyncUseCase.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// EmoticonUseCase.swift
// SyncUseCase.swift
// AsyncC
//
// Created by Jin Lee on 11/8/24.
Expand All @@ -22,7 +22,7 @@ final class SyncUseCase {
self.faceTimeUseCase = faceTimeUseCase
}

// MARK: - Send Emoticon
// MARK: - Send Sync

func requestForSync(receiver: String){
let sessionID = UUID().uuidString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension AppDelegate {
exitConfirmation?.isMovable = false
exitConfirmation?.collectionBehavior = [.canJoinAllSpaces, .stationary, .fullScreenAuxiliary]
exitConfirmation?.level = .popUpMenu
exitConfirmation?.contentViewController = NSHostingController(rootView: DisbandConfirmationView(viewModel: MainStatusViewModel(teamManagingUseCase: self.router.teamManagingUseCase, appTrackingUseCase: self.router.appTrackingUseCase, emoticonUseCase: self.router.syncUseCase, accountUseCase: self.router.accountManagingUseCase)).environmentObject(self.router))
exitConfirmation?.contentViewController = NSHostingController(rootView: DisbandConfirmationView(viewModel: MainStatusViewModel(teamManagingUseCase: self.router.teamManagingUseCase, appTrackingUseCase: self.router.appTrackingUseCase, syncUseCase: self.router.syncUseCase, accountUseCase: self.router.accountManagingUseCase)).environmentObject(self.router))

// Set the CornerRadius for the View inside the NSPanel
exitConfirmation?.contentView?.wantsLayer = true
Expand Down
2 changes: 1 addition & 1 deletion AsyncC/Source/Extension/Extension + ExitConfirmation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension AppDelegate {
exitConfirmation?.isMovable = false
exitConfirmation?.collectionBehavior = [.canJoinAllSpaces, .stationary, .fullScreenAuxiliary]
exitConfirmation?.level = .popUpMenu
exitConfirmation?.contentViewController = NSHostingController(rootView: ExitConfirmationView(viewModel: MainStatusViewModel(teamManagingUseCase: self.router.teamManagingUseCase, appTrackingUseCase: self.router.appTrackingUseCase, emoticonUseCase: self.router.syncUseCase, accountUseCase: self.router.accountManagingUseCase)).environmentObject(self.router))
exitConfirmation?.contentViewController = NSHostingController(rootView: ExitConfirmationView(viewModel: MainStatusViewModel(teamManagingUseCase: self.router.teamManagingUseCase, appTrackingUseCase: self.router.appTrackingUseCase, syncUseCase: self.router.syncUseCase, accountUseCase: self.router.accountManagingUseCase)).environmentObject(self.router))

// Set the CornerRadius for the View inside the NSPanel
exitConfirmation?.contentView?.wantsLayer = true
Expand Down
2 changes: 1 addition & 1 deletion AsyncC/Source/Extension/Extension + HUDWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extension AppDelegate {
viewModel: MainStatusViewModel(
teamManagingUseCase: self.router.teamManagingUseCase,
appTrackingUseCase: self.router.appTrackingUseCase,
syncUseCasee: self.router.syncUseCase,
syncUseCase: self.router.syncUseCase,
accountUseCase: self.router.accountManagingUseCase)
).environmentObject(self.router))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,26 @@ extension AppTrackingBoxView {
AppIconBoxContentView(viewModel: viewModel, key: key)
}
}
.padding(.trailing, 4)
if viewModel.userName != key {
SyncButton(viewModel: viewModel, key: key, action: {
if let userID = viewModel.userNameAndID[key] {
viewModel.syncUseCase.requestForSync(receiver: userID)
}
})
}
.padding(.trailing, 4)

if viewModel.userName != key {
SyncButton(viewModel: viewModel, key: key, action: {
if let userID = viewModel.userNameAndID[key] {
viewModel.syncUseCase.requestForSync(receiver: userID)
}
})
}
}
}
.padding(.vertical, 4.5)
.padding(.horizontal, 16)

if key == viewModel.userName {
Rectangle()
.fill(.clear)
.frame(height: 1)
.overlay {
Divider()

if key == viewModel.userName {
Rectangle()
.fill(.clear)
.frame(height: 1)
.overlay {
Divider()
}
.padding(.vertical, 12)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@ class MainStatusViewModel: ObservableObject {
@Published var isToggled: Bool = true
@Published var isMenuVisible: Bool = false
@Published var userNameAndID: [String: String] = [:] // [userName: userID]
@Published var emailToUserId: [String: String] = [:] // Email-to-ID mapping
@Published var isSelectedButton: Bool = false
@Published var buttonStates: [String: Bool] = [:]

init(teamManagingUseCase: TeamManagingUseCase, appTrackingUseCase: AppTrackingUseCase, syncUseCase: SyncUseCase, accountUseCase: AccountManagingUseCase) {
self.teamManagingUseCase = teamManagingUseCase
self.appTrackingUseCase = appTrackingUseCase
self.syncUseCase = emoticonUseCase
self.syncUseCase = syncUseCase
self.accountUseCase = accountUseCase

appTrackingUseCase.$teamTrackingStatus
Expand Down

0 comments on commit 52ed492

Please sign in to comment.