Accept friend request to redirect to friends page
This commit is contained in:
1 parent
458396f782
commit
6bc7c2f48c
2 files changed
+11
-1
No files matched your search
@@ -49,6 +49,11 @@ export function Befriend() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (response.status === 'accepted') {
|
||||
window.location.href = '/account/friends?c=fa';
|
||||
return;
|
||||
}
|
||||
|
||||
setUser(response);
|
||||
}
|
||||
|
||||
@@ -78,8 +83,12 @@ export function Befriend() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (response.status === 'accepted') {
|
||||
window.location.href = '/account/friends?c=fa';
|
||||
return;
|
||||
}
|
||||
|
||||
setUser(response);
|
||||
toast.success(successMessage);
|
||||
}
|
||||
|
||||
async function deleteFriend(userId: string, successMessage: string) {
|
||||
|
||||
@@ -13,6 +13,7 @@ export interface Props {}
|
||||
const messageCodes: Record<string, string> = {
|
||||
tl: 'Successfully left the team',
|
||||
fs: 'Friend request sent',
|
||||
fa: 'Friend request accepted',
|
||||
};
|
||||
|
||||
export function Toaster(props: Props) {
|
||||
|
||||
Reference in new issue
Block a user