From 9874b91e7c8c90454a64699a42558aa28680154d Mon Sep 17 00:00:00 2001 From: shinhong_park Date: Wed, 2 Oct 2024 16:05:26 +0900 Subject: [PATCH] Add sleep --- SNUTT-2022/SNUTT/Services/FriendsService.swift | 1 - SNUTT-2022/SNUTT/ViewModels/FriendsViewModel.swift | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/SNUTT-2022/SNUTT/Services/FriendsService.swift b/SNUTT-2022/SNUTT/Services/FriendsService.swift index ab1ebedd..6561a354 100644 --- a/SNUTT-2022/SNUTT/Services/FriendsService.swift +++ b/SNUTT-2022/SNUTT/Services/FriendsService.swift @@ -12,7 +12,6 @@ import ReactNativeKit enum RNEvent: String, SupportedEvent { case addFriendKakao = "add-friend-kakao" - case closeModal = "close-modal" } @MainActor diff --git a/SNUTT-2022/SNUTT/ViewModels/FriendsViewModel.swift b/SNUTT-2022/SNUTT/ViewModels/FriendsViewModel.swift index 5c974f75..ad634c3b 100644 --- a/SNUTT-2022/SNUTT/ViewModels/FriendsViewModel.swift +++ b/SNUTT-2022/SNUTT/ViewModels/FriendsViewModel.swift @@ -73,9 +73,9 @@ extension FriendsViewModel { var errorDescription: String? { switch self { case .shareUnavailable: - "카카오톡 초대 기능을 사용할 수 없습니다." + "카카오톡 초대 기능을 사용할 수 없습니다" case .preparationFailed, .unknownError: - "알 수 없는 오류가 발생했습니다." + "알 수 없는 오류가 발생했습니다" } } @@ -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)