mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #2755 from overleaf/jpa-fix-race-in-references-boot
[frontend] ReferencesManager: fix a race condition with the socket boot GitOrigin-RevId: cf21970bfc95128047d519b7c03ea0a29740174c
This commit is contained in:
parent
1dc325d1c7
commit
674afe400d
1 changed files with 4 additions and 12 deletions
|
@ -49,20 +49,12 @@ define(['crypto-js/sha1'], function(CryptoJSSHA1) {
|
||||||
// not on every reconnect
|
// not on every reconnect
|
||||||
if (!this.inited) {
|
if (!this.inited) {
|
||||||
this.inited = true
|
this.inited = true
|
||||||
return this.indexAllReferences(false)
|
this.ide.socket.on('references:keys:updated', keys =>
|
||||||
|
this._storeReferencesKeys(keys)
|
||||||
|
)
|
||||||
|
this.indexAllReferences(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(
|
|
||||||
self =>
|
|
||||||
self.ide.socket.on('references:keys:updated', keys =>
|
|
||||||
// console.log '>> got keys from socket'
|
|
||||||
self._storeReferencesKeys(keys)
|
|
||||||
),
|
|
||||||
|
|
||||||
1000,
|
|
||||||
this
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_storeReferencesKeys(newKeys) {
|
_storeReferencesKeys(newKeys) {
|
||||||
|
|
Loading…
Reference in a new issue