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)
|
||||
|
||||
let communityDescription: CommunityDescription | undefined = undefined
|
||||
try {
|
||||
await this.waku.store.queryWithOrderedCallback(
|
||||
[
|
||||
createDecoder(contentTopic, symmetricKey, {
|
||||
|
@ -175,7 +176,8 @@ class RequestClient {
|
|||
}
|
||||
|
||||
if (
|
||||
message.type !== ApplicationMetadataMessage_Type.COMMUNITY_DESCRIPTION
|
||||
message.type !==
|
||||
ApplicationMetadataMessage_Type.COMMUNITY_DESCRIPTION
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
@ -238,9 +240,12 @@ class RequestClient {
|
|||
}
|
||||
|
||||
// stop
|
||||
return true
|
||||
throw new Error('stop')
|
||||
}
|
||||
)
|
||||
} catch {
|
||||
// eslint-disable-next-line no-empty
|
||||
}
|
||||
|
||||
return communityDescription
|
||||
}
|
||||
|
@ -255,6 +260,7 @@ class RequestClient {
|
|||
|
||||
let contactCodeAdvertisement: ContactCodeAdvertisement | undefined =
|
||||
undefined
|
||||
try {
|
||||
await this.waku.store.queryWithOrderedCallback(
|
||||
[
|
||||
createDecoder(contentTopic, symmetricKey, {
|
||||
|
@ -305,9 +311,12 @@ class RequestClient {
|
|||
}
|
||||
|
||||
// stop
|
||||
return true
|
||||
throw new Error('stop')
|
||||
}
|
||||
)
|
||||
} catch {
|
||||
// eslint-disable-next-line no-empty
|
||||
}
|
||||
|
||||
return contactCodeAdvertisement
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue