Revert "Sidebar all favorites toggle" - causes UI crash

This reverts commit e848f2549fd1ec0d1c125893cc796f3a7d7b06a7.
This commit is contained in:
Natsumi
2024-06-30 05:31:00 +12:00
parent 8293de6a37
commit 697cda4674
3 changed files with 14 additions and 52 deletions

View File

@@ -9049,12 +9049,10 @@ speechSynthesis.getVoices();
}
var ref = API.cachedUsers.get(id);
var isVIP = this.localFavoriteFriends.has(id);
var isFavorite = API.cachedFavoritesByObjectId.has(id);
var ctx = {
id,
state: state || 'offline',
isVIP,
isFavorite,
ref,
name: '',
no: ++this.friendsNo,
@@ -9084,7 +9082,7 @@ speechSynthesis.getVoices();
}
this.friends.set(id, ctx);
if (ctx.state === 'online') {
if ((this.sidebarAllFavorites && ctx.isFavorite) || ctx.isVIP) {
if (ctx.isVIP) {
this.friendsGroup0_.push(ctx);
this.friendsGroupA_.unshift(ctx);
this.sortFriendsGroup0 = true;
@@ -9111,7 +9109,7 @@ speechSynthesis.getVoices();
}
this.friends.delete(id);
if (ctx.state === 'online') {
if ((this.sidebarAllFavorites && ctx.isFavorite) || ctx.isVIP) {
if (ctx.isVIP) {
removeFromArray(this.friendsGroup0_, ctx);
removeFromArray(this.friendsGroupA_, ctx);
} else {
@@ -9182,7 +9180,6 @@ speechSynthesis.getVoices();
}
var ref = API.cachedUsers.get(id);
var isVIP = this.localFavoriteFriends.has(id);
var isFavorite = API.cachedFavoritesByObjectId.has(id);
var location = '';
var $location_at = '';
if (typeof ref !== 'undefined') {
@@ -9201,10 +9198,7 @@ speechSynthesis.getVoices();
userId: id
});
}
if (
(this.sidebarAllFavorites && ctx.isFavorite) ||
ctx.isVIP
) {
if (ctx.isVIP) {
removeFromArray(this.friendsGroupA_, ctx);
this.friendsGroupA_.unshift(ctx);
this.sortFriendsGroup0 = true;
@@ -9221,14 +9215,10 @@ speechSynthesis.getVoices();
this.friendsGroupD_.push(ctx);
}
}
if (ctx.isVIP !== isVIP || ctx.isFavorite !== isFavorite) {
if (ctx.isVIP !== isVIP) {
ctx.isVIP = isVIP;
ctx.isFavorite = isFavorite;
if (ctx.state === 'online') {
if (
(this.sidebarAllFavorites && ctx.isFavorite) ||
ctx.isVIP
) {
if (ctx.isVIP) {
removeFromArray(this.friendsGroup1_, ctx);
removeFromArray(this.friendsGroupB_, ctx);
this.friendsGroup0_.push(ctx);
@@ -9246,10 +9236,7 @@ speechSynthesis.getVoices();
if (typeof ref !== 'undefined' && ctx.name !== ref.displayName) {
ctx.name = ref.displayName;
if (ctx.state === 'online') {
if (
(this.sidebarAllFavorites && ctx.isFavorite) ||
ctx.isVIP
) {
if (ctx.isVIP) {
this.sortFriendsGroup0 = true;
} else {
this.sortFriendsGroup1 = true;
@@ -9277,7 +9264,6 @@ speechSynthesis.getVoices();
) {
ctx.ref = ref;
ctx.isVIP = isVIP;
ctx.isFavorite = isFavorite;
if (typeof ref !== 'undefined') {
ctx.name = ref.displayName;
}
@@ -9312,7 +9298,6 @@ speechSynthesis.getVoices();
} else {
ctx.ref = ref;
ctx.isVIP = isVIP;
ctx.isFavorite = isFavorite;
if (typeof ref !== 'undefined') {
ctx.name = ref.displayName;
}
@@ -9334,8 +9319,6 @@ speechSynthesis.getVoices();
$location_at
) {
var date = this.APILastOnline.get(id);
var isVIP = this.localFavoriteFriends.has(id);
var isFavorite = API.cachedFavoritesByObjectId.has(id);
if (
ctx.state === 'online' &&
(stateInput === 'active' || stateInput === 'offline') &&
@@ -9353,6 +9336,7 @@ speechSynthesis.getVoices();
}
return;
}
var isVIP = this.localFavoriteFriends.has(id);
var newState = stateInput;
var args = await API.getUser({
userId: id
@@ -9417,7 +9401,7 @@ speechSynthesis.getVoices();
}
}
if (ctx.state === 'online') {
if ((this.sidebarAllFavorites && ctx.isFavorite) || ctx.isVIP) {
if (ctx.isVIP) {
removeFromArray(this.friendsGroup0_, ctx);
removeFromArray(this.friendsGroupA_, ctx);
} else {
@@ -9432,7 +9416,7 @@ speechSynthesis.getVoices();
removeFromArray(this.friendsGroupD_, ctx);
}
if (newState === 'online') {
if ((this.sidebarAllFavorites && isFavorite) || isVIP) {
if (isVIP) {
this.friendsGroup0_.push(ctx);
this.friendsGroupA_.unshift(ctx);
this.sortFriendsGroup0 = true;
@@ -9456,7 +9440,6 @@ speechSynthesis.getVoices();
ctx.state = newState;
ctx.name = newRef.displayName;
ctx.isVIP = isVIP;
ctx.isFavorite = isFavorite;
};
$app.methods.getWorldName = async function (location) {
@@ -9507,7 +9490,7 @@ speechSynthesis.getVoices();
}
var ctx = this.friends.get(userId);
if (typeof ctx.ref !== 'undefined' && ctx.state === 'online') {
if ((this.sidebarAllFavorites && ctx.isFavorite) || ctx.isVIP) {
if (ctx.isVIP) {
removeFromArray(this.friendsGroupA_, ctx);
this.friendsGroupA_.unshift(ctx);
this.sortFriendsGroup1 = true;
@@ -28134,11 +28117,6 @@ speechSynthesis.getVoices();
// #endregion
// #region | Local Favorite Friends
$app.data.sidebarAllFavorites = await configRepository.getBool(
'VRCX_sidebarAllFavorites',
false
);
$app.data.localFavoriteFriends = new Set();
$app.data.localFavoriteFriendsGroups = JSON.parse(
await configRepository.getString(
@@ -28165,36 +28143,27 @@ speechSynthesis.getVoices();
'VRCX_localFavoriteFriendsGroups',
JSON.stringify(this.localFavoriteFriendsGroups)
);
configRepository.setBool(
'VRCX_sidebarAllFavorites',
this.sidebarAllFavorites
);
};
$app.methods.updateSidebarFriendsList = function () {
for (var ctx of this.friends.values()) {
var isVIP = this.localFavoriteFriends.has(ctx.id);
var isFavorite = API.cachedFavoritesByObjectId.has(ctx.id);
if (ctx.isVIP === isVIP) {
continue;
}
ctx.isVIP = isVIP;
ctx.isFavorite = isFavorite;
if (ctx.state !== 'online') {
continue;
}
if ((this.sidebarAllFavorites && ctx.isFavorite) || ctx.isVIP) {
if (ctx.isVIP) {
removeFromArray(this.friendsGroup1_, ctx);
removeFromArray(this.friendsGroupB_, ctx);
if (this.friendsGroup0_.includes(ctx)) {
continue;
}
this.friendsGroup0_.push(ctx);
this.friendsGroupA_.unshift(ctx);
this.sortFriendsGroup0 = true;
} else {
removeFromArray(this.friendsGroup0_, ctx);
removeFromArray(this.friendsGroupA_, ctx);
if (this.friendsGroup1_.includes(ctx)) {
continue;
}
this.friendsGroup1_.push(ctx);
this.friendsGroupB_.unshift(ctx);
this.sortFriendsGroup1 = true;

View File

@@ -282,9 +282,6 @@
},
"side_panel": {
"header": "Side Panel",
"favorites": "Favorites",
"vrcx": "VRCX",
"all": "All",
"sorting": {
"header": "Sorting",
"sort_private_to_bottom": "Sort Private to bottom",

View File

@@ -191,10 +191,6 @@ mixin settingsTab()
div.options-container
span.header {{ $t('view.settings.appearance.side_panel.header') }}
br
div.options-container-item
span.name {{ $t('view.settings.appearance.side_panel.favorites') }}
el-switch(v-model="sidebarAllFavorites" :inactive-text="$t('view.settings.appearance.side_panel.vrcx')" :active-text="$t('view.settings.appearance.side_panel.all')" @change="updateLocalFavoriteFriends")
br
span.sub-header {{ $t('view.settings.appearance.side_panel.sorting.header') }}
div.options-container-item
span.name {{ $t('view.settings.appearance.side_panel.sorting.sort_private_to_bottom') }}