From 77645a710c61a3d752075e4c56822746f1b9ad7d Mon Sep 17 00:00:00 2001 From: Bojan Mojsilovic Date: Fri, 19 Jan 2024 16:27:40 +0100 Subject: [PATCH] LOGER --- src/lib/feed.ts | 3 ++- src/sockets.tsx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/feed.ts b/src/lib/feed.ts index 5aa961b0..8b4d22f3 100644 --- a/src/lib/feed.ts +++ b/src/lib/feed.ts @@ -25,6 +25,7 @@ export const getFutureFeed = (user_pubkey: string | undefined, pubkey: string | export const getFeed = (user_pubkey: string | undefined, pubkey: string | undefined, subid: string, until = 0, limit = 20, include_replies?: boolean) => { console.log('FEED PUBKEY: ', pubkey) if (!pubkey) { + console.log('FEED NO PUBKEY'); return; } @@ -40,7 +41,7 @@ export const getFeed = (user_pubkey: string | undefined, pubkey: string | undef payload.include_replies = include_replies; } - console.log('FEED SEND MESSAGE: ', payload) + console.log('FEED MESSAGE: ', payload) sendMessage(JSON.stringify([ "REQ", subid, diff --git a/src/sockets.tsx b/src/sockets.tsx index 864439ff..105a8b96 100644 --- a/src/sockets.tsx +++ b/src/sockets.tsx @@ -76,6 +76,9 @@ export const sendMessage = (message: string) => { const hook = (window as PrimalWindow).onPrimalCacheServerMessageSent; hook && hook(cacheServer, message); + } else { + console.log('FEED RECONNECT') + setTimeout(() => sendMessage(message), 1_000); } }