From c4a5de31f3ace17c4fabeb83b58370b5f620543d Mon Sep 17 00:00:00 2001 From: matty Date: Mon, 30 Jun 2025 17:19:24 -0400 Subject: [PATCH] refactor to make a little more sense at a glance --- src/main.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 26fbc51..b69d580 100644 --- a/src/main.ts +++ b/src/main.ts @@ -116,7 +116,8 @@ const generateOllamaRequest = async ( }); const ollamaResponse: OllamaResponse = await response.json(); await storePromptData(notification, ollamaResponse); - await postReplyToStatus(notification, ollamaResponse); + // await postReplyToStatus(notification, ollamaResponse); + return ollamaResponse; } } catch (error: any) { throw new Error(error.message); @@ -166,8 +167,11 @@ const postReplyToStatus = async ( if (notifications) { await Promise.all( - notifications.map((notification) => { - generateOllamaRequest(notification); + notifications.map(async (notification) => { + const ollamaResponse = await generateOllamaRequest(notification); + if (ollamaResponse) { + postReplyToStatus(notification, ollamaResponse); + } }) ); }