mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Refresh friends loading indicator, refresh notifications fixes
This commit is contained in:
+20
-24
@@ -1782,10 +1782,15 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
API.isRefreshFriendsLoading = false;
|
||||||
|
|
||||||
API.refreshFriends = async function () {
|
API.refreshFriends = async function () {
|
||||||
|
this.isRefreshFriendsLoading = true;
|
||||||
var onlineFriends = await this.refreshOnlineFriends();
|
var onlineFriends = await this.refreshOnlineFriends();
|
||||||
var offlineFriends = await this.refreshOfflineFriends();
|
var offlineFriends = await this.refreshOfflineFriends();
|
||||||
return onlineFriends.concat(offlineFriends);
|
var friends = onlineFriends.concat(offlineFriends);
|
||||||
|
this.isRefreshFriendsLoading = false;
|
||||||
|
return friends;
|
||||||
};
|
};
|
||||||
|
|
||||||
API.refreshOnlineFriends = async function () {
|
API.refreshOnlineFriends = async function () {
|
||||||
@@ -2238,33 +2243,24 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
API.refreshNotifications = function () {
|
API.refreshNotifications = async function () {
|
||||||
// NOTE : 캐시 때문에 after=~ 로는 갱신이 안됨. 그래서 첨부터 불러옴
|
|
||||||
if (this.isNotificationsLoading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.isNotificationsLoading = true;
|
this.isNotificationsLoading = true;
|
||||||
this.expireNotifications();
|
this.expireNotifications();
|
||||||
this.expireNotifications();
|
var params = {
|
||||||
this.getNotifications({ n: 100 }).then(() => {
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.deleteExpiredNotifcations();
|
this.deleteExpiredNotifcations();
|
||||||
this.isNotificationsLoading = false;
|
this.isNotificationsLoading = false;
|
||||||
$app.unseenNotifications = [];
|
|
||||||
});
|
|
||||||
// this.bulk({
|
|
||||||
// fn: 'getNotifications',
|
|
||||||
// N: -1,
|
|
||||||
// params: {
|
|
||||||
// n: 50,
|
|
||||||
// offset: 0
|
|
||||||
// },
|
|
||||||
// done(ok) {
|
|
||||||
// if (ok) {
|
|
||||||
// this.deleteExpiredNotifcations();
|
|
||||||
// }
|
|
||||||
// this.isNotificationsLoading = false;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
+1
-1
@@ -903,7 +903,7 @@ html
|
|||||||
el-tooltip(placement="bottom" content="Direct access ID/URL" :disabled="hideTooltips")
|
el-tooltip(placement="bottom" content="Direct access ID/URL" :disabled="hideTooltips")
|
||||||
el-button(type="default" @click="promptOmniDirectDialog()" size="mini" icon="el-icon-discover" circle)
|
el-button(type="default" @click="promptOmniDirectDialog()" size="mini" icon="el-icon-discover" circle)
|
||||||
el-tooltip(placement="bottom" content="Refresh friends" :disabled="hideTooltips")
|
el-tooltip(placement="bottom" content="Refresh friends" :disabled="hideTooltips")
|
||||||
el-button(type="default" @click="API.getCurrentUser(); API.refreshFriends()" size="mini" icon="el-icon-refresh" circle)
|
el-button(type="default" @click="API.getCurrentUser(); API.refreshFriends()" :loading="API.isRefreshFriendsLoading" size="mini" icon="el-icon-refresh" circle style="margin-right:10px")
|
||||||
.x-friend-list(style="padding-bottom:10px")
|
.x-friend-list(style="padding-bottom:10px")
|
||||||
.x-friend-group
|
.x-friend-group
|
||||||
i.el-icon-arrow-right(:class="{ rotate: isFriendsGroupMe }")
|
i.el-icon-arrow-right(:class="{ rotate: isFriendsGroupMe }")
|
||||||
|
|||||||
Reference in New Issue
Block a user