Skip to content

Commit

Permalink
Add sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
shp7724 committed Oct 2, 2024
1 parent 844c683 commit 9874b91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion SNUTT-2022/SNUTT/Services/FriendsService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ReactNativeKit

enum RNEvent: String, SupportedEvent {
case addFriendKakao = "add-friend-kakao"
case closeModal = "close-modal"
}

@MainActor
Expand Down
6 changes: 3 additions & 3 deletions SNUTT-2022/SNUTT/ViewModels/FriendsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ extension FriendsViewModel {
var errorDescription: String? {
switch self {
case .shareUnavailable:
"카카오톡 초대 기능을 사용할 수 없습니다."
"카카오톡 초대 기능을 사용할 수 없습니다"
case .preparationFailed, .unknownError:
"알 수 없는 오류가 발생했습니다."
"알 수 없는 오류가 발생했습니다"
}
}

Expand Down Expand Up @@ -114,7 +114,7 @@ extension FriendsViewModel {
}

func sendKakaoMessage(with requestToken: String) async throws {
await eventEmitter.emitEvent(RNEvent.closeModal)
try await Task.sleep(nanoseconds: 500_000_000)
guard ShareApi.isKakaoTalkSharingAvailable() else { throw FriendRequestError.shareUnavailable }
let params = ["type": RNEvent.addFriendKakao.rawValue, "requestToken": requestToken]
let link = Link(androidExecutionParams: params, iosExecutionParams: params)
Expand Down

0 comments on commit 9874b91

Please sign in to comment.