mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Group moderation tool fixes
This commit is contained in:
@@ -1121,6 +1121,9 @@
|
|||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!groupMemberModeration.value.visible) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
groupBansModerationTable.data = fetchedBans;
|
groupBansModerationTable.data = fetchedBans;
|
||||||
} catch {
|
} catch {
|
||||||
@@ -1291,6 +1294,9 @@
|
|||||||
allSuccess = false;
|
allSuccess = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!groupMemberModeration.value.visible) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (allSuccess) {
|
if (allSuccess) {
|
||||||
toast.success(`Roles removed`);
|
toast.success(`Roles removed`);
|
||||||
@@ -1333,6 +1339,9 @@
|
|||||||
allSuccess = false;
|
allSuccess = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!groupMemberModeration.value.visible) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (allSuccess) {
|
if (allSuccess) {
|
||||||
toast.success(`Added group member roles`);
|
toast.success(`Added group member roles`);
|
||||||
@@ -1405,6 +1414,7 @@
|
|||||||
}
|
}
|
||||||
const count = 50; // 5000 max
|
const count = 50; // 5000 max
|
||||||
isGroupMembersLoading.value = true;
|
isGroupMembersLoading.value = true;
|
||||||
|
let newData = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
@@ -1415,9 +1425,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const json of args.json.results) {
|
for (const json of args.json.results) {
|
||||||
const existsInData = groupLogsModerationTable.data.some((dataItem) => dataItem.id === json.id);
|
const existsInData = newData.some((dataItem) => dataItem.id === json.id);
|
||||||
if (!existsInData) {
|
if (!existsInData) {
|
||||||
groupLogsModerationTable.data.push(json);
|
newData.push(json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1425,7 +1435,11 @@
|
|||||||
if (!args.json.hasNext) {
|
if (!args.json.hasNext) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!groupMemberModeration.value.visible) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
groupLogsModerationTable.data = newData;
|
||||||
} catch {
|
} catch {
|
||||||
toast.error('Failed to get group logs');
|
toast.error('Failed to get group logs');
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1575,6 +1589,7 @@
|
|||||||
const params = { groupId, n: 100, offset: 0, blocked: true };
|
const params = { groupId, n: 100, offset: 0, blocked: true };
|
||||||
const count = 50; // 5000
|
const count = 50; // 5000
|
||||||
isGroupMembersLoading.value = true;
|
isGroupMembersLoading.value = true;
|
||||||
|
let newData = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
@@ -1582,18 +1597,19 @@
|
|||||||
if (groupMemberModeration.value.id !== args.params.groupId) {
|
if (groupMemberModeration.value.id !== args.params.groupId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const targetTable = args.params.blocked
|
|
||||||
? groupBlockedModerationTable
|
|
||||||
: groupJoinRequestsModerationTable;
|
|
||||||
for (const json of args.json) {
|
for (const json of args.json) {
|
||||||
const ref = applyGroupMember(json);
|
const ref = applyGroupMember(json);
|
||||||
targetTable.data.push(ref);
|
newData.push(ref);
|
||||||
}
|
}
|
||||||
params.offset += params.n;
|
params.offset += params.n;
|
||||||
if (args.json.length < params.n) {
|
if (args.json.length < params.n) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!groupMemberModeration.value.visible) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
groupBlockedModerationTable.data = newData;
|
||||||
} catch {
|
} catch {
|
||||||
toast.error('Failed to get group join requests');
|
toast.error('Failed to get group join requests');
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1606,24 +1622,27 @@
|
|||||||
const params = { groupId, n: 100, offset: 0, blocked: false };
|
const params = { groupId, n: 100, offset: 0, blocked: false };
|
||||||
const count = 50; // 5000 max
|
const count = 50; // 5000 max
|
||||||
isGroupMembersLoading.value = true;
|
isGroupMembersLoading.value = true;
|
||||||
|
let newData = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
const args = await groupRequest.getGroupJoinRequests(params);
|
const args = await groupRequest.getGroupJoinRequests(params);
|
||||||
if (groupMemberModeration.value.id !== args.params.groupId) {
|
if (groupMemberModeration.value.id !== args.params.groupId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const targetTable = args.params.blocked
|
|
||||||
? groupBlockedModerationTable
|
|
||||||
: groupJoinRequestsModerationTable;
|
|
||||||
for (const json of args.json) {
|
for (const json of args.json) {
|
||||||
const ref = applyGroupMember(json);
|
const ref = applyGroupMember(json);
|
||||||
targetTable.data.push(ref);
|
newData.push(ref);
|
||||||
}
|
}
|
||||||
params.offset += params.n;
|
params.offset += params.n;
|
||||||
if (args.json.length < params.n) {
|
if (args.json.length < params.n) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!groupMemberModeration.value.visible) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
groupJoinRequestsModerationTable.data = newData;
|
||||||
} catch {
|
} catch {
|
||||||
toast.error('Failed to get group join requests');
|
toast.error('Failed to get group join requests');
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1636,6 +1655,7 @@
|
|||||||
const params = { groupId, n: 100, offset: 0 };
|
const params = { groupId, n: 100, offset: 0 };
|
||||||
const count = 50; // 5000 max
|
const count = 50; // 5000 max
|
||||||
isGroupMembersLoading.value = true;
|
isGroupMembersLoading.value = true;
|
||||||
|
let newData = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (let i = 0; i < count; i++) {
|
for (let i = 0; i < count; i++) {
|
||||||
@@ -1644,10 +1664,9 @@
|
|||||||
if (groupMemberModeration.value.id !== args.params.groupId) {
|
if (groupMemberModeration.value.id !== args.params.groupId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const json of args.json) {
|
for (const json of args.json) {
|
||||||
const ref = applyGroupMember(json);
|
const ref = applyGroupMember(json);
|
||||||
groupInvitesModerationTable.data.push(ref);
|
newData.push(ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
params.offset += params.n;
|
params.offset += params.n;
|
||||||
@@ -1658,6 +1677,7 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
groupInvitesModerationTable.data = newData;
|
||||||
} catch {
|
} catch {
|
||||||
toast.error('Failed to get group invites');
|
toast.error('Failed to get group invites');
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user