mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
improve performance
This commit is contained in:
@@ -125,8 +125,17 @@ export const useSearchStore = defineStore('Search', () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (query.length < 2) {
|
||||||
|
state.quickSearchItems = quickSearchUserHistory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const results = [];
|
const results = [];
|
||||||
const cleanQuery = removeWhitespace(query);
|
const cleanQuery = removeWhitespace(query);
|
||||||
|
if (!cleanQuery) {
|
||||||
|
state.quickSearchItems = quickSearchUserHistory();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (const ctx of friendStore.friends.values()) {
|
for (const ctx of friendStore.friends.values()) {
|
||||||
if (typeof ctx.ref === 'undefined') {
|
if (typeof ctx.ref === 'undefined') {
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
<el-icon class="rotation-transition" :class="{ 'is-rotated': isActiveFriends }"><ArrowRight /></el-icon>
|
<el-icon class="rotation-transition" :class="{ 'is-rotated': isActiveFriends }"><ArrowRight /></el-icon>
|
||||||
<span style="margin-left: 5px">{{ t('side_panel.active') }} ― {{ activeFriends.length }}</span>
|
<span style="margin-left: 5px">{{ t('side_panel.active') }} ― {{ activeFriends.length }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="isActiveFriends">
|
<div v-if="isActiveFriends">
|
||||||
<friend-item
|
<friend-item
|
||||||
v-for="friend in activeFriends"
|
v-for="friend in activeFriends"
|
||||||
:key="friend.id"
|
:key="friend.id"
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
<el-icon class="rotation-transition" :class="{ 'is-rotated': isOfflineFriends }"><ArrowRight /></el-icon>
|
<el-icon class="rotation-transition" :class="{ 'is-rotated': isOfflineFriends }"><ArrowRight /></el-icon>
|
||||||
<span style="margin-left: 5px">{{ t('side_panel.offline') }} ― {{ offlineFriends.length }}</span>
|
<span style="margin-left: 5px">{{ t('side_panel.offline') }} ― {{ offlineFriends.length }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="isOfflineFriends">
|
<div v-if="isOfflineFriends">
|
||||||
<friend-item
|
<friend-item
|
||||||
v-for="friend in offlineFriends"
|
v-for="friend in offlineFriends"
|
||||||
:key="friend.id"
|
:key="friend.id"
|
||||||
|
|||||||
Reference in New Issue
Block a user