mirror of
https://github.com/logos-messaging/logos-messaging-frontend.git
synced 2026-01-02 13:53:13 +00:00
Merge pull request #15 from waku-org/weboko/follow-up
fix: increase interval, add minor fixes
This commit is contained in:
commit
daca898ba9
@ -109,9 +109,12 @@ export class RLN implements IRLN {
|
||||
|
||||
private initKeystore(): Keystore {
|
||||
const localKeystoreString = localStorage.getItem("keystore");
|
||||
const _keystore = Keystore.fromString(localKeystoreString || "");
|
||||
|
||||
return _keystore || Keystore.create();
|
||||
|
||||
try {
|
||||
return Keystore.fromString(localKeystoreString || "");
|
||||
} catch(error) {
|
||||
return Keystore.create();
|
||||
}
|
||||
}
|
||||
|
||||
public addEventListener(name: RLNEventsNames, fn: EventListener) {
|
||||
|
||||
@ -53,7 +53,7 @@ class Relay {
|
||||
|
||||
this.subscriptionRoutine = window.setInterval(async () => {
|
||||
await this.fetchMessages();
|
||||
}, SECOND);
|
||||
}, 10 * SECOND);
|
||||
|
||||
this.contentTopicListeners.set(contentTopic, 1);
|
||||
} catch (error) {
|
||||
@ -84,7 +84,7 @@ class Relay {
|
||||
}
|
||||
|
||||
private async fetchMessages(): Promise<void> {
|
||||
const contentTopic = Object.keys(this.contentTopicListeners)[0];
|
||||
const contentTopic = Array.from(this.contentTopicListeners.keys())[0];
|
||||
|
||||
if (!contentTopic) {
|
||||
return;
|
||||
|
||||
@ -5,9 +5,7 @@ export const http = {
|
||||
mode: "no-cors",
|
||||
referrerPolicy: "no-referrer",
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
'Content-Type': 'text/plain',
|
||||
},
|
||||
body: JSON.stringify(body)
|
||||
});
|
||||
@ -18,9 +16,7 @@ export const http = {
|
||||
mode: "no-cors",
|
||||
referrerPolicy: "no-referrer",
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
'Content-Type': 'text/plain',
|
||||
},
|
||||
body: JSON.stringify(body)
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user