mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
Small changes
This commit is contained in:
111
html/src/app.js
111
html/src/app.js
@@ -2805,45 +2805,49 @@ speechSynthesis.getVoices();
|
||||
|
||||
API.refreshNotifications = async function () {
|
||||
this.isNotificationsLoading = true;
|
||||
this.expireFriendRequestNotifications();
|
||||
var params = {
|
||||
n: 100,
|
||||
offset: 0
|
||||
};
|
||||
var count = 50; // 5000 max
|
||||
for (var i = 0; i < count; i++) {
|
||||
var args = await this.getNotifications(params);
|
||||
$app.unseenNotifications = [];
|
||||
params.offset += 100;
|
||||
if (args.json.length < 100) {
|
||||
break;
|
||||
try {
|
||||
this.expireFriendRequestNotifications();
|
||||
var params = {
|
||||
n: 100,
|
||||
offset: 0
|
||||
};
|
||||
var count = 50; // 5000 max
|
||||
for (var i = 0; i < count; i++) {
|
||||
var args = await this.getNotifications(params);
|
||||
$app.unseenNotifications = [];
|
||||
params.offset += 100;
|
||||
if (args.json.length < 100) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
var params = {
|
||||
n: 100,
|
||||
offset: 0
|
||||
};
|
||||
var count = 50; // 5000 max
|
||||
for (var i = 0; i < count; i++) {
|
||||
var args = await this.getNotificationsV2(params);
|
||||
$app.unseenNotifications = [];
|
||||
params.offset += 100;
|
||||
if (args.json.length < 100) {
|
||||
break;
|
||||
var params = {
|
||||
n: 100,
|
||||
offset: 0
|
||||
};
|
||||
var count = 50; // 5000 max
|
||||
for (var i = 0; i < count; i++) {
|
||||
var args = await this.getNotificationsV2(params);
|
||||
$app.unseenNotifications = [];
|
||||
params.offset += 100;
|
||||
if (args.json.length < 100) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
var params = {
|
||||
n: 100,
|
||||
offset: 0
|
||||
};
|
||||
var count = 50; // 5000 max
|
||||
for (var i = 0; i < count; i++) {
|
||||
var args = await this.getHiddenFriendRequests(params);
|
||||
$app.unseenNotifications = [];
|
||||
params.offset += 100;
|
||||
if (args.json.length < 100) {
|
||||
break;
|
||||
var params = {
|
||||
n: 100,
|
||||
offset: 0
|
||||
};
|
||||
var count = 50; // 5000 max
|
||||
for (var i = 0; i < count; i++) {
|
||||
var args = await this.getHiddenFriendRequests(params);
|
||||
$app.unseenNotifications = [];
|
||||
params.offset += 100;
|
||||
if (args.json.length < 100) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
this.isNotificationsLoading = false;
|
||||
};
|
||||
@@ -2933,6 +2937,28 @@ speechSynthesis.getVoices();
|
||||
});
|
||||
});
|
||||
|
||||
API.$on('NOTIFICATION:V2:UPDATE', function (args) {
|
||||
var notificationId = args.params.notificationId;
|
||||
var json = args.json;
|
||||
if (!json) {
|
||||
return;
|
||||
}
|
||||
json.id = notificationId;
|
||||
this.$emit('NOTIFICATION', {
|
||||
json,
|
||||
params: {
|
||||
notificationId
|
||||
}
|
||||
});
|
||||
if (json.seen) {
|
||||
this.$emit('NOTIFICATION:SEE', {
|
||||
params: {
|
||||
notificationId
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
params: {
|
||||
notificationId: string,
|
||||
@@ -4183,6 +4209,16 @@ speechSynthesis.getVoices();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'notification-v2-update':
|
||||
console.log('notification-v2-update', content);
|
||||
this.$emit('NOTIFICATION:V2:UPDATE', {
|
||||
json: content.updates,
|
||||
params: {
|
||||
notificationId: content.id
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 'see-notification':
|
||||
this.$emit('NOTIFICATION:SEE', {
|
||||
params: {
|
||||
@@ -11161,6 +11197,9 @@ speechSynthesis.getVoices();
|
||||
var partyId = `${L.worldId}:${L.instanceName}`;
|
||||
var partySize = this.lastLocation.playerList.size;
|
||||
var partyMaxSize = L.worldCapacity;
|
||||
if (partySize > partyMaxSize) {
|
||||
partyMaxSize = partySize;
|
||||
}
|
||||
var buttonText = 'Join';
|
||||
var buttonUrl = L.joinUrl;
|
||||
if (!this.discordJoinButton) {
|
||||
|
||||
@@ -776,11 +776,11 @@ html
|
||||
template(v-once #default="scope")
|
||||
template(v-if="scope.row.details && scope.row.details.imageUrl")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="scope.row.details.imageUrl" style="flex:none;width:90px;border-radius:4px")
|
||||
img.x-link(slot="reference" v-lazy="scope.row.details.imageUrl" style="flex:none;height:50px;border-radius:4px")
|
||||
img.x-link(v-lazy="scope.row.details.imageUrl" style="width:500px" @click="downloadAndSaveImage(scope.row.details.imageUrl)")
|
||||
template(v-else-if="scope.row.imageUrl")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="scope.row.imageUrl" style="flex:none;width:90px;border-radius:4px")
|
||||
img.x-link(slot="reference" v-lazy="scope.row.imageUrl" style="flex:none;height:50px;border-radius:4px")
|
||||
img.x-link(v-lazy="scope.row.imageUrl" style="width:500px" @click="downloadAndSaveImage(scope.row.imageUrl)")
|
||||
el-table-column(:label="$t('table.notification.message')" prop="message")
|
||||
template(v-once #default="scope")
|
||||
|
||||
@@ -393,14 +393,21 @@ Vue.component('marquee-text', MarqueeText);
|
||||
|
||||
if (!this.config.hideDevicesFromFeed) {
|
||||
AppApi.GetVRDevices().then((devices) => {
|
||||
var deviceList = [];
|
||||
var baseStations = 0;
|
||||
devices.forEach((device) => {
|
||||
device[2] = parseInt(device[2], 10);
|
||||
if (device[0] === 'base' && device[1] === 'connected') {
|
||||
baseStations++;
|
||||
} else {
|
||||
deviceList.unshift(device);
|
||||
}
|
||||
});
|
||||
devices.sort((a, b) => {
|
||||
deviceList.sort((a, b) => {
|
||||
if (a[0] === b[0]) {
|
||||
return 0;
|
||||
}
|
||||
if (a[0] === 'base') {
|
||||
if (a[0] === 'tracker' || a[0] === 'base') {
|
||||
return 1;
|
||||
}
|
||||
if (a[0].toLowerCase().includes('controller')) {
|
||||
@@ -408,7 +415,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
devices.sort((a, b) => {
|
||||
deviceList.sort((a, b) => {
|
||||
if (a[1] === b[1]) {
|
||||
return 0;
|
||||
}
|
||||
@@ -420,7 +427,10 @@ Vue.component('marquee-text', MarqueeText);
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
this.devices = devices;
|
||||
if (baseStations > 0) {
|
||||
deviceList.push(['base', 'connected', baseStations]);
|
||||
}
|
||||
this.devices = deviceList;
|
||||
});
|
||||
} else {
|
||||
this.devices = [];
|
||||
|
||||
@@ -437,6 +437,7 @@ html
|
||||
template(v-else-if="device[0] === 'base'")
|
||||
img(v-if="device[1] !== 'connected'" src="images/base_status_off.png" class="tracker-device")
|
||||
img(v-else src="images/base_status_ready.png" class="tracker-device")
|
||||
span(v-if="device[2] !== 100") {{ device[2] }}x
|
||||
template(v-else)
|
||||
img(v-if="device[1] !== 'connected'" src="images/other_status_off.png" class="tracker-device")
|
||||
img(v-else-if="device[2] < 20" src="images/other_status_ready_low.png" class="tracker-device")
|
||||
|
||||
Reference in New Issue
Block a user