mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-12 03:13:50 +02:00
chagne menu item order, cleanup code
This commit is contained in:
46
html/app.js
46
html/app.js
@@ -1803,6 +1803,20 @@ CefSharp.BindObjectAsync(
|
||||
return '';
|
||||
};
|
||||
|
||||
API.parseInviteLocation = function (ref) {
|
||||
try {
|
||||
var L = API.parseLocation(ref.details.worldId);
|
||||
if (L.worldId !== '' && L.instanceId !== '') {
|
||||
return `${ref.details.worldName} #${L.instanceName} ${L.accessType}`;
|
||||
}
|
||||
return ref.message ||
|
||||
ref.details.worldId ||
|
||||
ref.details.worldName;
|
||||
} catch (err) {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
// API: PlayerModeration
|
||||
|
||||
API.cachedPlayerModerations = new Map();
|
||||
@@ -4834,20 +4848,21 @@ CefSharp.BindObjectAsync(
|
||||
});
|
||||
|
||||
API.$on('PLAYER-MODERATION', function (args) {
|
||||
var { ref } = args;
|
||||
var insertOrUpdate = $app.playerModerationTable.data.some((val, idx, arr) => {
|
||||
if (val.id === args.ref.id) {
|
||||
if (args.ref.$isExpired) {
|
||||
if (val.id === ref.id) {
|
||||
if (ref.$isExpired) {
|
||||
Vue.delete(arr, idx);
|
||||
} else {
|
||||
Vue.set(arr, idx, args.ref);
|
||||
Vue.set(arr, idx, ref);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (!insertOrUpdate &&
|
||||
!args.ref.$isExpired) {
|
||||
$app.playerModerationTable.data.push(args.ref);
|
||||
!ref.$isExpired) {
|
||||
$app.playerModerationTable.data.push(ref);
|
||||
$app.notifyMenu('moderation');
|
||||
}
|
||||
});
|
||||
@@ -4920,20 +4935,21 @@ CefSharp.BindObjectAsync(
|
||||
});
|
||||
|
||||
API.$on('NOTIFICATION', function (args) {
|
||||
var { ref } = args;
|
||||
var insertOrUpdate = $app.notificationTable.data.some((val, idx, arr) => {
|
||||
if (val.id === args.ref.id) {
|
||||
if (args.ref.$isExpired) {
|
||||
if (val.id === ref.id) {
|
||||
if (ref.$isExpired) {
|
||||
Vue.delete(arr, idx);
|
||||
} else {
|
||||
Vue.set(arr, idx, args.ref);
|
||||
Vue.set(arr, idx, ref);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (!insertOrUpdate &&
|
||||
!args.ref.$isExpired) {
|
||||
$app.notificationTable.data.push(args.ref);
|
||||
!ref.$isExpired) {
|
||||
$app.notificationTable.data.push(ref);
|
||||
$app.notifyMenu('notification');
|
||||
}
|
||||
});
|
||||
@@ -4948,16 +4964,6 @@ CefSharp.BindObjectAsync(
|
||||
});
|
||||
});
|
||||
|
||||
$app.methods.parseInviteLocation = function (row) {
|
||||
try {
|
||||
var L = API.parseLocation(row.details.worldId);
|
||||
return `${row.details.worldName} #${L.instanceName} ${L.accessType}`;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
$app.methods.acceptNotification = function (row) {
|
||||
// FIXME: 메시지 수정
|
||||
this.$confirm('Continue? Accept Friend Request', 'Confirm', {
|
||||
|
||||
@@ -510,7 +510,7 @@
|
||||
<template v-once #default="scope">
|
||||
<el-tooltip placement="top" v-if="scope.row.type === 'invite'">
|
||||
<template #content>
|
||||
<span v-text="parseInviteLocation(scope.row)"></span>
|
||||
<span v-text="API.parseInviteLocation(scope.row)"></span>
|
||||
</template>
|
||||
<span v-text="scope.row.type" @click="showWorldDialog(scope.row.details.worldId)" class="x-link"></span>
|
||||
</el-tooltip>
|
||||
@@ -914,10 +914,8 @@
|
||||
<el-dropdown trigger="click" @command="userDialogCommand" size="small">
|
||||
<el-button :type="(userDialog.incomingRequest || userDialog.outgoingRequest) ? 'success' : (userDialog.isBlock || userDialog.isMute || userDialog.isHideAvatar) ? 'danger' : 'default'" icon="el-icon-more" circle></el-button>
|
||||
<el-dropdown-menu #default="dropdown">
|
||||
<el-dropdown-item icon="el-icon-s-custom" command="Show Avatar Author">Show Avatar Author</el-dropdown-item>
|
||||
<template v-if="userDialog.isFriend">
|
||||
<el-dropdown-item icon="el-icon-message" command="Message">Message</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-delete" command="Unfriend" divided>Unfriend</el-dropdown-item>
|
||||
</template>
|
||||
<template v-else-if="userDialog.incomingRequest">
|
||||
<el-dropdown-item icon="el-icon-check" command="Accept Friend Request">Accept Friend Request</el-dropdown-item>
|
||||
@@ -925,12 +923,16 @@
|
||||
</template>
|
||||
<el-dropdown-item v-else-if="userDialog.outgoingRequest" icon="el-icon-close" command="Cancel Friend Request">Cancel Friend Request</el-dropdown-item>
|
||||
<el-dropdown-item v-else icon="el-icon-plus" command="Send Friend Request">Send Friend Request</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-s-custom" command="Show Avatar Author" divided>Show Avatar Author</el-dropdown-item>
|
||||
<el-dropdown-item v-if="userDialog.isBlock" icon="el-icon-circle-check" command="Unblock" divided style="color:#F56C6C">Unblock</el-dropdown-item>
|
||||
<el-dropdown-item v-else icon="el-icon-circle-close" command="Block" divided>Block</el-dropdown-item>
|
||||
<el-dropdown-item v-if="userDialog.isMute" icon="el-icon-microphone" command="Unmute" style="color:#F56C6C">Unmute</el-dropdown-item>
|
||||
<el-dropdown-item v-else icon="el-icon-turn-off-microphone" command="Mute">Mute</el-dropdown-item>
|
||||
<el-dropdown-item v-if="userDialog.isHideAvatar" icon="el-icon-user-solid" command="Show Avatar" style="color:#F56C6C">Show Avatar</el-dropdown-item>
|
||||
<el-dropdown-item v-else icon="el-icon-user" command="Hide Avatar">Hide Avatar</el-dropdown-item>
|
||||
<template v-if="userDialog.isFriend">
|
||||
<el-dropdown-item icon="el-icon-delete" command="Unfriend" divided>Unfriend</el-dropdown-item>
|
||||
</template>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user