Skip to content

Commit

Permalink
[friends-native] 에러 핸들링 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ars-ki-00 committed Oct 5, 2024
1 parent 47b85ac commit 2f236f4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { FriendTimetable } from './FriendTimetable';
import { ManageFriendsDrawerContent } from './ManageFriendsDrawerContent';
import { RequestFriendsBottomSheetContent } from './RequestFriendsBottomSheetContent';
import { AcceptFriendWithKakaoResponse } from '../../../repositories/responses/Friend';
import { get } from '../../../utils/get';

export type RequestFriendModalStep = 'METHOD_LIST' | 'REQUEST_WITH_NICKNAME';

Expand Down Expand Up @@ -126,8 +127,9 @@ export const MainScreen = () => {

dispatch({ type: 'setFriend', friendId: response.id });
},
onError: () => {
Alert.alert('친구 추가를 실패했습니다.\n잠시 후, 다시 시도해 주세요.');
onError: (err) => {
const message = get(err, ['displayMessage']);
Alert.alert(message ? `${message}` : '친구 추가를 실패했습니다.\n잠시 후, 다시 시도해 주세요.');
},
},
);
Expand Down

0 comments on commit 2f236f4

Please sign in to comment.