aboutsummaryrefslogtreecommitdiff
path: root/apps/web
diff options
context:
space:
mode:
authorDhravya Shah <[email protected]>2024-07-24 17:47:58 -0500
committerDhravya Shah <[email protected]>2024-07-24 17:47:58 -0500
commit3c22a45df3f09ba12164ea5c43ca5211355e4748 (patch)
tree5d3f6a832259eeea264676f54bec18f5372a0f2e /apps/web
parentfix breadcrumbs and btter handling (diff)
downloadsupermemory-3c22a45df3f09ba12164ea5c43ca5211355e4748.tar.xz
supermemory-3c22a45df3f09ba12164ea5c43ca5211355e4748.zip
parse suggestions for handling edge case
Diffstat (limited to 'apps/web')
-rw-r--r--apps/web/app/(dash)/home/history.tsx4
-rw-r--r--apps/web/app/(dash)/home/page.tsx16
2 files changed, 10 insertions, 10 deletions
diff --git a/apps/web/app/(dash)/home/history.tsx b/apps/web/app/(dash)/home/history.tsx
index c1f8d9d4..307ef4e3 100644
--- a/apps/web/app/(dash)/home/history.tsx
+++ b/apps/web/app/(dash)/home/history.tsx
@@ -20,6 +20,10 @@ const History = memo(({ setQuery }: { setQuery: (q: string) => void }) => {
return;
}
console.log(suggestions);
+ if (typeof suggestions.data === "string") {
+ setSuggestions(JSON.parse(suggestions.data));
+ return;
+ }
setSuggestions(suggestions.data.reverse().slice(0, 3));
})();
}, []);
diff --git a/apps/web/app/(dash)/home/page.tsx b/apps/web/app/(dash)/home/page.tsx
index dfcac577..d192d07d 100644
--- a/apps/web/app/(dash)/home/page.tsx
+++ b/apps/web/app/(dash)/home/page.tsx
@@ -11,7 +11,7 @@ import {
} from "@/app/actions/doers";
import { toast } from "sonner";
import { motion } from "framer-motion";
-import { ChromeIcon, GithubIcon, TwitterIcon } from "lucide-react";
+import { ChromeIcon, GithubIcon, MailIcon, TwitterIcon } from "lucide-react";
import Link from "next/link";
import History from "./history";
@@ -52,10 +52,6 @@ function Page({ searchParams }: { searchParams: Record<string, string> }) {
linkTelegram();
}
- if (extensionInstalled) {
- toast.success("Extension installed successfully");
- }
-
getSpaces().then((res) => {
if (res.success && res.data) {
setSpaces(res.data);
@@ -66,15 +62,15 @@ function Page({ searchParams }: { searchParams: Record<string, string> }) {
getSessionAuthToken().then((token) => {
if (typeof window === "undefined") return;
+ if (extensionInstalled) {
+ toast.success("Extension installed successfully");
+ }
window.postMessage({ token: token.data }, "*");
});
}, [telegramUser]);
return (
<div className="max-w-3xl h-full justify-center flex mx-auto w-full flex-col px-2 md:px-0">
- {/* all content goes here */}
- {/* <div className="">hi {firstTime ? 'first time' : ''}</div> */}
-
<motion.h1
{...{
...slap,
@@ -127,12 +123,12 @@ function Page({ searchParams }: { searchParams: Record<string, string> }) {
Install extension
</Link>
<Link
- href="https://github.com/supermemoryai/supermemory/issues/new"
+ href="mailto:[email protected]"
target="_blank"
rel="noreferrer"
className="flex items-center gap-2 text-muted-foreground hover:text-grey-50 duration-300"
>
- <GithubIcon className="w-4 h-4" />
+ <MailIcon className="w-4 h-4" />
Bug report
</Link>
<Link