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

@@ -813,7 +813,7 @@ speechSynthesis.getVoices();
"<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>' +
'<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>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: {
@@ -946,7 +946,7 @@ speechSynthesis.getVoices();
'<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>' +
'<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>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: {
@@ -1229,6 +1229,7 @@ speechSynthesis.getVoices();
API.logout = function () {
this.$emit('LOGOUT');
webApiService.clearCookies();
// return this.call('logout', {
// method: 'PUT'
// }).finally(() => {
@@ -5523,7 +5524,9 @@ speechSynthesis.getVoices();
playOverlayNotification = true;
}
var message = '';
if (noty.message) {
if (noty.title) {
message = `${noty.title}, ${noty.message}`;
} else if (noty.message) {
message = noty.message;
}
var messageList = [
@@ -11989,6 +11992,10 @@ speechSynthesis.getVoices();
this.updateSharedFeed(true);
API.getUser({
userId: id
}).then(() => {
if (this.userDialog.visible && id === this.userDialog.id) {
this.applyUserDialogLocation(true);
}
});
}
});
@@ -13493,7 +13500,7 @@ speechSynthesis.getVoices();
$app.methods.promptOmniDirectDialog = function () {
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',
{
distinguishCancelAndClose: true,
@@ -22850,9 +22857,11 @@ speechSynthesis.getVoices();
}
*/
API.getGroup = function (params) {
// includeRoles=true
return this.call(`groups/${params.groupId}`, {
method: 'GET'
method: 'GET',
params: {
includeRoles: params.includeRoles || false
}
}).then((json) => {
var args = {
json,
@@ -23263,8 +23272,7 @@ speechSynthesis.getVoices();
API.getGroupInstances = function (params) {
return this.call(`groups/${params.groupId}/instances`, {
method: 'GET',
params
method: 'GET'
}).then((json) => {
var args = {
json,
@@ -23376,6 +23384,8 @@ speechSynthesis.getVoices();
_updated_at: ''
},
updatedAt: '',
// includeRoles: true
roles: [],
// group list
$memberId: '',
groupId: '',
@@ -23440,7 +23450,6 @@ speechSynthesis.getVoices();
announcement: {},
members: [],
instances: [],
roles: [],
memberRoles: []
};
@@ -23459,7 +23468,6 @@ speechSynthesis.getVoices();
D.treeData = [];
D.announcement = {};
D.instances = [];
D.roles = [];
D.memberRoles = [];
if (this.groupDialogLastMembers !== groupId) {
D.members = [];
@@ -23495,7 +23503,7 @@ speechSynthesis.getVoices();
$app.methods.getGroupDialogGroup = function (groupId) {
var D = this.groupDialog;
return API.getGroup({groupId})
return API.getGroup({groupId, includeRoles: true})
.catch((err) => {
throw err;
})
@@ -23503,6 +23511,16 @@ speechSynthesis.getVoices();
if (D.id === args1.ref.id) {
D.ref = args1.ref;
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) {
API.getGroupAnnouncement({
groupId
@@ -23537,23 +23555,6 @@ speechSynthesis.getVoices();
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') {
this.groupDialogLastActiveTab = 'Info';
@@ -23626,7 +23627,6 @@ speechSynthesis.getVoices();
D.treeData = buildTreeData({
group: D.ref,
announcement: D.announcement,
roles: D.roles,
instances: D.instances,
members: D.members
});