Skip to content

Commit

Permalink
[friends-native] 카톡 친구추가 api 실패 에러 핸들링 (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
ars-ki-00 authored Oct 6, 2024
1 parent 59979a8 commit f4685a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export const RequestFriendsMethodList = () => {
/>
<Typography>카카오톡으로 친구 초대</Typography>
</TouchableOpacity>
</View>
<View style={styles.sheetContent}>
<TouchableOpacity style={styles.sheetItem} onPress={() => setRequestFriendModalStep('REQUEST_WITH_NICKNAME')}>
<UserHashtagIcon
width={30}
Expand Down
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,6 +127,10 @@ export const MainScreen = () => {

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

0 comments on commit f4685a6

Please sign in to comment.