feat: build username index on startup
This commit is contained in:
parent
73b38d37e7
commit
c4b9b397a6
2 changed files with 31 additions and 1 deletions
|
|
@ -86,10 +86,15 @@ class ClientService extends EventTarget {
|
|||
public static getInstance(): ClientService {
|
||||
if (!ClientService.instance) {
|
||||
ClientService.instance = new ClientService()
|
||||
ClientService.instance.init()
|
||||
}
|
||||
return ClientService.instance
|
||||
}
|
||||
|
||||
async init() {
|
||||
await indexedDb.iterateProfileEvents((profileEvent) => this.addUsernameToIndex(profileEvent))
|
||||
}
|
||||
|
||||
listConnectionStatus() {
|
||||
return this.pool.listConnectionStatus()
|
||||
}
|
||||
|
|
@ -851,5 +856,4 @@ class ClientService extends EventTarget {
|
|||
}
|
||||
|
||||
const instance = ClientService.getInstance()
|
||||
|
||||
export default instance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue