stop fetching early (#539)
* stop fetching early * Create yellow-pets-invent.md
This commit is contained in:
parent
550774e291
commit
6b4e6b1566
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"@status-im/js": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
stop fetching early
|
|
@ -159,6 +159,7 @@ class RequestClient {
|
||||||
const symmetricKey = await generateKeyFromPassword(publicKey)
|
const symmetricKey = await generateKeyFromPassword(publicKey)
|
||||||
|
|
||||||
let communityDescription: CommunityDescription | undefined = undefined
|
let communityDescription: CommunityDescription | undefined = undefined
|
||||||
|
try {
|
||||||
await this.waku.store.queryWithOrderedCallback(
|
await this.waku.store.queryWithOrderedCallback(
|
||||||
[
|
[
|
||||||
createDecoder(contentTopic, symmetricKey, {
|
createDecoder(contentTopic, symmetricKey, {
|
||||||
|
@ -175,7 +176,8 @@ class RequestClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
message.type !== ApplicationMetadataMessage_Type.COMMUNITY_DESCRIPTION
|
message.type !==
|
||||||
|
ApplicationMetadataMessage_Type.COMMUNITY_DESCRIPTION
|
||||||
) {
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -238,9 +240,12 @@ class RequestClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
// stop
|
// stop
|
||||||
return true
|
throw new Error('stop')
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
} catch {
|
||||||
|
// eslint-disable-next-line no-empty
|
||||||
|
}
|
||||||
|
|
||||||
return communityDescription
|
return communityDescription
|
||||||
}
|
}
|
||||||
|
@ -255,6 +260,7 @@ class RequestClient {
|
||||||
|
|
||||||
let contactCodeAdvertisement: ContactCodeAdvertisement | undefined =
|
let contactCodeAdvertisement: ContactCodeAdvertisement | undefined =
|
||||||
undefined
|
undefined
|
||||||
|
try {
|
||||||
await this.waku.store.queryWithOrderedCallback(
|
await this.waku.store.queryWithOrderedCallback(
|
||||||
[
|
[
|
||||||
createDecoder(contentTopic, symmetricKey, {
|
createDecoder(contentTopic, symmetricKey, {
|
||||||
|
@ -305,9 +311,12 @@ class RequestClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
// stop
|
// stop
|
||||||
return true
|
throw new Error('stop')
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
} catch {
|
||||||
|
// eslint-disable-next-line no-empty
|
||||||
|
}
|
||||||
|
|
||||||
return contactCodeAdvertisement
|
return contactCodeAdvertisement
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue