Small fixes

This commit is contained in:
Natsumi
2022-12-19 01:52:48 +13:00
parent dc77363c3f
commit 3079efa7fd
4 changed files with 39 additions and 39 deletions

View File

@@ -528,7 +528,7 @@ namespace VRCX
public Dictionary<string, short> GetVRChatModerations(string currentUserId) public Dictionary<string, short> GetVRChatModerations(string currentUserId)
{ {
var filePath = Path.Combine(GetVRChatAppDataLocation(), "LocalPlayerModerations", $"{currentUserId}-show-hide-user.vrcset"); var filePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + $@"Low\VRChat\VRChat\LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset";
if (!File.Exists(filePath)) if (!File.Exists(filePath))
return null; return null;
@@ -555,7 +555,7 @@ namespace VRCX
public short GetVRChatUserModeration(string currentUserId, string userId) public short GetVRChatUserModeration(string currentUserId, string userId)
{ {
var filePath = Path.Combine(GetVRChatAppDataLocation(), "LocalPlayerModerations", $"{currentUserId}-show-hide-user.vrcset"); var filePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + $@"Low\VRChat\VRChat\LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset";
if (!File.Exists(filePath)) if (!File.Exists(filePath))
return 0; return 0;
@@ -579,7 +579,7 @@ namespace VRCX
public bool SetVRChatUserModeration(string currentUserId, string userId, int type) public bool SetVRChatUserModeration(string currentUserId, string userId, int type)
{ {
var filePath = Path.Combine(GetVRChatAppDataLocation(), "LocalPlayerModerations", $"{currentUserId}-show-hide-user.vrcset"); var filePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + $@"Low\VRChat\VRChat\LocalPlayerModerations\{currentUserId}-show-hide-user.vrcset";
if (!File.Exists(filePath)) if (!File.Exists(filePath))
return false; return false;

View File

@@ -813,7 +813,7 @@ speechSynthesis.getVoices();
"<span><span @click=\"showWorldDialog\" :class=\"{ 'x-link': link && this.location !== 'private' && this.location !== 'offline'}\">" + "<span><span @click=\"showWorldDialog\" :class=\"{ 'x-link': link && this.location !== 'private' && this.location !== 'offline'}\">" +
'<i v-if="isTraveling" class="el-icon el-icon-loading" style="display:inline-block;margin-right:5px"></i>' + '<i v-if="isTraveling" class="el-icon el-icon-loading" style="display:inline-block;margin-right:5px"></i>' +
'<span style="margin-right:5px">{{ text }}</span></span>' + '<span style="margin-right:5px">{{ text }}</span></span>' +
'<span v-if="groupName" @click="showGroupDialog" class="x-link" style="margin-right:5px">{{ groupName }}</span>' + '<span v-if="groupName" @click="showGroupDialog" class="x-link" style="margin-right:5px">({{ groupName }})</span>' +
'<span class="flags" :class="region" style="display:inline-block"></span>' + '<span class="flags" :class="region" style="display:inline-block"></span>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>', '<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: { props: {
@@ -946,7 +946,7 @@ speechSynthesis.getVoices();
'<span><span @click="showLaunchDialog" class="x-link">' + '<span><span @click="showLaunchDialog" class="x-link">' +
'<i v-if="isUnlocked" class="el-icon el-icon-unlock" style="display:inline-block;margin-right:5px"></i>' + '<i v-if="isUnlocked" class="el-icon el-icon-unlock" style="display:inline-block;margin-right:5px"></i>' +
'<span style="margin-right:5px"> #{{ instanceName }} {{ accessType }}</span></span>' + '<span style="margin-right:5px"> #{{ instanceName }} {{ accessType }}</span></span>' +
'<span v-if="groupName" @click="showGroupDialog" class="x-link" style="margin-right:5px">{{ groupName }}</span>' + '<span v-if="groupName" @click="showGroupDialog" class="x-link" style="margin-right:5px">({{ groupName }})</span>' +
'<span class="flags" :class="region" style="display:inline-block"></span>' + '<span class="flags" :class="region" style="display:inline-block"></span>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>', '<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: { props: {
@@ -1229,6 +1229,7 @@ speechSynthesis.getVoices();
API.logout = function () { API.logout = function () {
this.$emit('LOGOUT'); this.$emit('LOGOUT');
webApiService.clearCookies();
// return this.call('logout', { // return this.call('logout', {
// method: 'PUT' // method: 'PUT'
// }).finally(() => { // }).finally(() => {
@@ -5523,7 +5524,9 @@ speechSynthesis.getVoices();
playOverlayNotification = true; playOverlayNotification = true;
} }
var message = ''; var message = '';
if (noty.message) { if (noty.title) {
message = `${noty.title}, ${noty.message}`;
} else if (noty.message) {
message = noty.message; message = noty.message;
} }
var messageList = [ var messageList = [
@@ -11989,6 +11992,10 @@ speechSynthesis.getVoices();
this.updateSharedFeed(true); this.updateSharedFeed(true);
API.getUser({ API.getUser({
userId: id userId: id
}).then(() => {
if (this.userDialog.visible && id === this.userDialog.id) {
this.applyUserDialogLocation(true);
}
}); });
} }
}); });
@@ -13493,7 +13500,7 @@ speechSynthesis.getVoices();
$app.methods.promptOmniDirectDialog = function () { $app.methods.promptOmniDirectDialog = function () {
this.$prompt( this.$prompt(
'Enter a User/World/Instance/Avatar URL or ID (UUID)', 'Enter a User/World/Instance/Avatar/Group URL or ID (UUID)',
'Direct Access', 'Direct Access',
{ {
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
@@ -22850,9 +22857,11 @@ speechSynthesis.getVoices();
} }
*/ */
API.getGroup = function (params) { API.getGroup = function (params) {
// includeRoles=true
return this.call(`groups/${params.groupId}`, { return this.call(`groups/${params.groupId}`, {
method: 'GET' method: 'GET',
params: {
includeRoles: params.includeRoles || false
}
}).then((json) => { }).then((json) => {
var args = { var args = {
json, json,
@@ -23263,8 +23272,7 @@ speechSynthesis.getVoices();
API.getGroupInstances = function (params) { API.getGroupInstances = function (params) {
return this.call(`groups/${params.groupId}/instances`, { return this.call(`groups/${params.groupId}/instances`, {
method: 'GET', method: 'GET'
params
}).then((json) => { }).then((json) => {
var args = { var args = {
json, json,
@@ -23376,6 +23384,8 @@ speechSynthesis.getVoices();
_updated_at: '' _updated_at: ''
}, },
updatedAt: '', updatedAt: '',
// includeRoles: true
roles: [],
// group list // group list
$memberId: '', $memberId: '',
groupId: '', groupId: '',
@@ -23440,7 +23450,6 @@ speechSynthesis.getVoices();
announcement: {}, announcement: {},
members: [], members: [],
instances: [], instances: [],
roles: [],
memberRoles: [] memberRoles: []
}; };
@@ -23459,7 +23468,6 @@ speechSynthesis.getVoices();
D.treeData = []; D.treeData = [];
D.announcement = {}; D.announcement = {};
D.instances = []; D.instances = [];
D.roles = [];
D.memberRoles = []; D.memberRoles = [];
if (this.groupDialogLastMembers !== groupId) { if (this.groupDialogLastMembers !== groupId) {
D.members = []; D.members = [];
@@ -23495,7 +23503,7 @@ speechSynthesis.getVoices();
$app.methods.getGroupDialogGroup = function (groupId) { $app.methods.getGroupDialogGroup = function (groupId) {
var D = this.groupDialog; var D = this.groupDialog;
return API.getGroup({groupId}) return API.getGroup({groupId, includeRoles: true})
.catch((err) => { .catch((err) => {
throw err; throw err;
}) })
@@ -23503,6 +23511,16 @@ speechSynthesis.getVoices();
if (D.id === args1.ref.id) { if (D.id === args1.ref.id) {
D.ref = args1.ref; D.ref = args1.ref;
D.inGroup = args1.ref.membershipStatus === 'member'; D.inGroup = args1.ref.membershipStatus === 'member';
for (var role of args1.ref.roles) {
if (
D.ref &&
D.ref.myMember &&
Array.isArray(D.ref.myMember.roleIds) &&
D.ref.myMember.roleIds.includes(role.id)
) {
D.memberRoles.push(role);
}
}
if (D.inGroup) { if (D.inGroup) {
API.getGroupAnnouncement({ API.getGroupAnnouncement({
groupId groupId
@@ -23537,23 +23555,6 @@ speechSynthesis.getVoices();
this.applyGroupDialogInstances(args3.json); this.applyGroupDialogInstances(args3.json);
} }
}); });
API.getGroupRoles({
groupId
}).then((args4) => {
if (groupId === args4.params.groupId) {
D.roles = args4.json;
for (var role of args4.json) {
if (
D.ref &&
D.ref.myMember &&
Array.isArray(D.ref.myMember.roleIds) &&
D.ref.myMember.roleIds.includes(role.id)
) {
D.memberRoles.push(role);
}
}
}
});
} }
if (this.$refs.groupDialogTabs.currentName === '0') { if (this.$refs.groupDialogTabs.currentName === '0') {
this.groupDialogLastActiveTab = 'Info'; this.groupDialogLastActiveTab = 'Info';
@@ -23626,7 +23627,6 @@ speechSynthesis.getVoices();
D.treeData = buildTreeData({ D.treeData = buildTreeData({
group: D.ref, group: D.ref,
announcement: D.announcement, announcement: D.announcement,
roles: D.roles,
instances: D.instances, instances: D.instances,
members: D.members members: D.members
}); });

View File

@@ -173,8 +173,8 @@ html
span(v-else-if="scope.row.status === 'ask me'") Ask Me span(v-else-if="scope.row.status === 'ask me'") Ask Me
span(v-else-if="scope.row.status === 'busy'") Do Not Disturb span(v-else-if="scope.row.status === 'busy'") Do Not Disturb
span(v-else) Offline span(v-else) Offline
i.x-user-status(:class="statusClass(scope.row.status)") i.x-user-status(:class="statusClass(scope.row.status)" style="margin-right:5px")
span(v-if="scope.row.statusDescription !== scope.row.previousStatusDescription" v-text="scope.row.statusDescription" style="margin-left:5px") span(v-if="scope.row.statusDescription !== scope.row.previousStatusDescription" v-text="scope.row.statusDescription")
span.x-link(v-else-if="scope.row.type === 'PortalSpawn'" @click="showWorldDialog(scope.row.location, scope.row.shortName)") span.x-link(v-else-if="scope.row.type === 'PortalSpawn'" @click="showWorldDialog(scope.row.location, scope.row.shortName)")
location(:location="scope.row.location" :hint="scope.row.worldName" :grouphint="scope.row.groupName" :link="false") location(:location="scope.row.location" :hint="scope.row.worldName" :grouphint="scope.row.groupName" :link="false")
span(v-else-if="scope.row.type === 'ChatBoxMessage'" v-text="scope.row.text") span(v-else-if="scope.row.type === 'ChatBoxMessage'" v-text="scope.row.text")
@@ -709,7 +709,6 @@ html
el-table-column(label="User" prop="displayName") el-table-column(label="User" prop="displayName")
template(v-once #default="scope") template(v-once #default="scope")
span(v-if="scope.row.type === 'DisplayName'") {{ scope.row.previousDisplayName }} #[i.el-icon-right] span(v-if="scope.row.type === 'DisplayName'") {{ scope.row.previousDisplayName }} #[i.el-icon-right]
| &nbsp;
span.x-link(v-text="scope.row.displayName || scope.row.userId" @click="showUserDialog(scope.row.userId)") span.x-link(v-text="scope.row.displayName || scope.row.userId" @click="showUserDialog(scope.row.userId)")
template(v-if="scope.row.type === 'TrustLevel'") template(v-if="scope.row.type === 'TrustLevel'")
span ({{ scope.row.previousTrustLevel }} #[i.el-icon-right] {{ scope.row.trustLevel }}) span ({{ scope.row.previousTrustLevel }} #[i.el-icon-right] {{ scope.row.trustLevel }})
@@ -785,7 +784,8 @@ html
img.x-link(v-lazy="scope.row.imageUrl" style="width:500px" @click="downloadAndSaveImage(scope.row.imageUrl)") img.x-link(v-lazy="scope.row.imageUrl" style="width:500px" @click="downloadAndSaveImage(scope.row.imageUrl)")
el-table-column(label="Message" prop="message") el-table-column(label="Message" prop="message")
template(v-once #default="scope") template(v-once #default="scope")
span(v-if="scope.row.message" v-text="scope.row.message") span(v-if="scope.row.title") {{ scope.row.title }}, {{ scope.row.message }}
span(v-else-if="scope.row.message" v-text="scope.row.message")
span(v-else-if='scope.row.details && scope.row.details.inviteMessage' v-text="scope.row.details.inviteMessage") span(v-else-if='scope.row.details && scope.row.details.inviteMessage' v-text="scope.row.details.inviteMessage")
span(v-else-if='scope.row.details && scope.row.details.requestMessage' v-text="scope.row.details.requestMessage") span(v-else-if='scope.row.details && scope.row.details.requestMessage' v-text="scope.row.details.requestMessage")
span(v-else-if='scope.row.details && scope.row.details.responseMessage' v-text="scope.row.details.responseMessage") span(v-else-if='scope.row.details && scope.row.details.responseMessage' v-text="scope.row.details.responseMessage")
@@ -2244,7 +2244,7 @@ html
el-dropdown-item(icon="el-icon-refresh" command="Refresh") Refresh el-dropdown-item(icon="el-icon-refresh" command="Refresh") Refresh
template(v-if="groupDialog.inGroup") template(v-if="groupDialog.inGroup")
template(v-if="groupDialog.ref.myMember") template(v-if="groupDialog.ref.myMember")
el-dropdown-item(v-if="groupDialog.ref.myMember.isSubscribedToAnnouncements" icon="el-icon-close" command="Unsubscribe To Announcements" divided) Unsubscribe To Announcements el-dropdown-item(v-if="groupDialog.ref.myMember.isSubscribedToAnnouncements" icon="el-icon-close" command="Unsubscribe To Announcements" divided) Unsubscribe From Announcements
el-dropdown-item(v-else icon="el-icon-check" command="Subscribe To Announcements" divided) Subscribe To Announcements el-dropdown-item(v-else icon="el-icon-check" command="Subscribe To Announcements" divided) Subscribe To Announcements
el-dropdown-item(v-if="hasGroupPermission(groupDialog.ref, 'group-invites-manage')" icon="el-icon-message" command="Invite To Group") Invite To Group el-dropdown-item(v-if="hasGroupPermission(groupDialog.ref, 'group-invites-manage')" icon="el-icon-message" command="Invite To Group") Invite To Group
template(v-if="groupDialog.ref.myMember && groupDialog.ref.privacy === 'default'") template(v-if="groupDialog.ref.myMember && groupDialog.ref.privacy === 'default'")

View File

@@ -80,7 +80,7 @@ Vue.component('marquee-text', MarqueeText);
Vue.component('location', { Vue.component('location', {
template: template:
'<span><span style="margin-right:5px">{{ text }}</span>' + '<span><span style="margin-right:5px">{{ text }}</span>' +
'<span v-if="groupName" style="margin-right:5px">{{ groupName }}</span>' + '<span v-if="groupName" style="margin-right:5px">({{ groupName }})</span>' +
'<span class="flags" :class="region" style="display:inline-block;margin-bottom:2px"></span>' + '<span class="flags" :class="region" style="display:inline-block;margin-bottom:2px"></span>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>', '<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: { props: {