From 2ee36e496364aebc2d9fd7f0ab3129690530aae2 Mon Sep 17 00:00:00 2001 From: talksik Date: Wed, 2 Feb 2022 00:24:07 -0800 Subject: [PATCH] making sure algolia errors if don't have env variables as we need it --- .../ConversationsFlow.md | 13 +++++++++++++ packages/web/services/algoliaSearchService.ts | 17 ++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) rename packages/common/models/clientModels/conversationData.md => documentation/ConversationsFlow.md (81%) diff --git a/packages/common/models/clientModels/conversationData.md b/documentation/ConversationsFlow.md similarity index 81% rename from packages/common/models/clientModels/conversationData.md rename to documentation/ConversationsFlow.md index b51ee8c..9e90008 100644 --- a/packages/common/models/clientModels/conversationData.md +++ b/documentation/ConversationsFlow.md @@ -12,6 +12,8 @@ this conversation had something going on (new link, new room, new clip...) AND other users just subscribe to this published source // -> users - A -> last interaction date // -> audioClips - c // -> links // -> live } +- also be able to see very cleraly who the last speaker was in the conversation + # Listeners ### A - listener for all - users within conversation documents @@ -45,3 +47,14 @@ all conversations in the conversation map and place in right category /\*\* - } \*/ // + +# Dashboard + +### Data Needed + +- live conversations going on right now and which people are in them +- all inbox-like conversations such as today, last 7 days, etc + a. being able to play the last message in the conversation with a play button + b. see if there is a new update in the conversation which I have not viewed +- priority conversations + a. need to be able to play any messages from there diff --git a/packages/web/services/algoliaSearchService.ts b/packages/web/services/algoliaSearchService.ts index 47e98c8..a892fe1 100644 --- a/packages/web/services/algoliaSearchService.ts +++ b/packages/web/services/algoliaSearchService.ts @@ -1,20 +1,11 @@ import algoliaSearch, { SearchClient } from "algoliasearch"; -var searchClient: SearchClient = null; - -if ( - process.env.NEXT_PUBLIC_ALGOLIA_APP_ID && +const searchClient: SearchClient = algoliaSearch( + process.env.NEXT_PUBLIC_ALGOLIA_APP_ID, process.env.NEXT_PUBLIC_ALGOLIA_API_KEY -) { - searchClient = algoliaSearch( - process.env.NEXT_PUBLIC_ALGOLIA_APP_ID, - process.env.NEXT_PUBLIC_ALGOLIA_API_KEY - ); +); - console.log("set up algolia search successfully"); -} else { - console.error("unable to set up aloglia"); -} +console.log("set up algolia search successfully"); export const usersIndex = searchClient.initIndex( process.env.NEXT_PUBLIC_ALGOLIA_USERS_INDEX_NAME || ""