mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-03 13:36:04 +02:00
friendly unfriend message
This commit is contained in:
+3
-2
@@ -63,9 +63,10 @@ const friendReq = {
|
|||||||
* @param {{ userId: string }} params
|
* @param {{ userId: string }} params
|
||||||
* @returns {Promise<{json: any, params: { userId: string }}>}
|
* @returns {Promise<{json: any, params: { userId: string }}>}
|
||||||
*/
|
*/
|
||||||
deleteFriend(params) {
|
deleteFriend(params, customMsg) {
|
||||||
return request(`auth/user/friends/${params.userId}`, {
|
return request(`auth/user/friends/${params.userId}`, {
|
||||||
method: 'DELETE'
|
method: 'DELETE',
|
||||||
|
customMsg
|
||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
const args = {
|
const args = {
|
||||||
json,
|
json,
|
||||||
|
|||||||
@@ -2110,9 +2110,12 @@
|
|||||||
reportUserForHacking(userId);
|
reportUserForHacking(userId);
|
||||||
break;
|
break;
|
||||||
case 'Unfriend':
|
case 'Unfriend':
|
||||||
args = await friendRequest.deleteFriend({
|
args = await friendRequest.deleteFriend(
|
||||||
|
{
|
||||||
userId
|
userId
|
||||||
});
|
},
|
||||||
|
t('dialog.user.actions.unfriend_success_msg')
|
||||||
|
);
|
||||||
handleFriendDelete(args);
|
handleFriendDelete(args);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -947,6 +947,7 @@
|
|||||||
"edit_pronouns": "Pronouns",
|
"edit_pronouns": "Pronouns",
|
||||||
"report_hacking": "Report For Hacking",
|
"report_hacking": "Report For Hacking",
|
||||||
"unfriend": "Unfriend",
|
"unfriend": "Unfriend",
|
||||||
|
"unfriend_success_msg": "Unfriended",
|
||||||
"logout": "Logout"
|
"logout": "Logout"
|
||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const t = i18n.global.t;
|
|||||||
/**
|
/**
|
||||||
* @template T
|
* @template T
|
||||||
* @param {string} endpoint
|
* @param {string} endpoint
|
||||||
* @param {RequestInit & { params?: any }} [options]
|
* @param {RequestInit & { params?: any } & {customMsg?: string}} [options]
|
||||||
* @returns {Promise<T>}
|
* @returns {Promise<T>}
|
||||||
*/
|
*/
|
||||||
export function request(endpoint, options) {
|
export function request(endpoint, options) {
|
||||||
@@ -159,7 +159,9 @@ export function request(endpoint, options) {
|
|||||||
if (text) {
|
if (text) {
|
||||||
new Noty({
|
new Noty({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
text: escapeTag(text)
|
text: options.customMsg
|
||||||
|
? options.customMsg
|
||||||
|
: escapeTag(text)
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
Reference in New Issue
Block a user