fix extra indexes not working

This commit is contained in:
Henry Jameson 2026-08-14 19:49:12 +03:00
commit 5ef72358aa

View file

@ -170,9 +170,15 @@ export const useUsersStore = defineStore('users', {
const { relationship: unused1, ...newUser } = user const { relationship: unused1, ...newUser } = user
// Initializing reactivity let reactive = this.users.get(user.id)
if (!this.users.has(user.id)) this.users.set(user.id, existing) // Initializing reactivity & avoiding excessive Map mutation
const reactive = this.users.get(user.id) if (!reactive) {
this.users.set(user.id, existing)
reactive = this.users.get(user.id)
this.usersByName.set(user.screen_name.toLowerCase(), reactive)
this.usersByURL.set(user.url.toLowerCase(), reactive)
}
// Relying on object reactivity to avoid mutating the Map // Relying on object reactivity to avoid mutating the Map
reactive.relationship = relationship reactive.relationship = relationship
@ -184,12 +190,6 @@ export const useUsersStore = defineStore('users', {
// Updating the timestamp // Updating the timestamp
this.timestamps.set(reactive, timestamp) this.timestamps.set(reactive, timestamp)
// Avoiding excessive Map mutation
if (!this.users.has(user.id)) {
this.usersByName.set(user.screen_name.toLowerCase(), reactive)
this.usersByURL.set(user.url.toLowerCase(), reactive)
}
if (user.id === this.currentUser?.id) { if (user.id === this.currentUser?.id) {
this.currentUser = reactive this.currentUser = reactive
} }