fix: tweets view

This commit is contained in:
Dhravya Shah 2025-03-17 15:18:40 -07:00
parent 8af182abaf
commit 5582402a9f
5 changed files with 17 additions and 24 deletions

View file

@ -1,18 +0,0 @@
import { fromHono } from "chanfana";
import { Hono } from "hono";
import { serve as serveHono } from "@hono/node-server";
const app = fromHono(new Hono());
app.get("/", (c) => {
return c.json({ message: "Hello, world!" });
});
app.get("/entry/:id", (c) => {
const id = c.req.param("id");
return c.json({ message: `Hello, ${id}!` });
});
serveHono(app, (info) => {
console.log(info);
});

View file

@ -88,18 +88,24 @@ const renderContent = {
return <CustomTwitterComp tweet={parsedData} />;
} catch (error) {
console.error("Error parsing raw tweet data:", error);
return <div className="p-4 text-muted-foreground">Error parsing tweet data</div>;
return (
<div className="p-4 text-muted-foreground">Error parsing tweet data. {rawContent}</div>
);
}
}
// Otherwise use normal tweet ID flow
const tweetId = ourData.content?.match(/\/status\/(\d+)/)?.[1] ?? ourData.content;
const tweetId = ourData.url?.match(/\/status\/(\d+)/)?.[1] ?? ourData.url;
const { data, error } = useTweet(tweetId ?? undefined);
if (error) {
console.error("Error parsing tweet:", error);
console.log("Tweet ID:", tweetId);
return <div className="p-4 text-muted-foreground">Error parsing tweet</div>;
return (
<div className="p-4 text-muted-foreground">
Error parsing tweet. {tweetId} {JSON.stringify(error)}
</div>
);
}
if (!data || typeof data == "undefined") {
@ -554,6 +560,7 @@ export function FetchAndRenderContent({ content }: { content: string }) {
isSuccessfullyProcessed: true,
errorMessage: null,
contentHash: null,
metadata: null,
};
setMemory(item);
return;
@ -579,6 +586,7 @@ export function FetchAndRenderContent({ content }: { content: string }) {
isSuccessfullyProcessed: true,
errorMessage: null,
contentHash: null,
metadata: null,
};
setMemory(item);
} catch (error) {
@ -599,6 +607,7 @@ export function FetchAndRenderContent({ content }: { content: string }) {
isSuccessfullyProcessed: false,
errorMessage: null,
contentHash: null,
metadata: null,
};
setMemory(item);
} finally {
@ -824,11 +833,11 @@ export const SpaceSelector = function SpaceSelector({
if (!spacesData?.spaces) return [];
return spacesData.spaces.filter(
(space) =>
space.name.toLowerCase().includes(search.toLowerCase()) && space.uuid !== (spaceId ? spaceId.split("---")[0] : "<HOME>"),
space.name.toLowerCase().includes(search.toLowerCase()) &&
space.uuid !== (spaceId ? spaceId.split("---")[0] : "<HOME>"),
);
}, [spacesData?.spaces, search]);
if (isLoading) {
return (
<DropdownMenuSubContent>

View file

@ -76,5 +76,6 @@ export default defineConfig((mode) => {
optimizeDeps: {
include: ["react-tweet"],
},
publicDir: "public",
} satisfies UserConfig;
});

View file

@ -22,6 +22,7 @@ interface Env {
NODE_ENV: string;
STRIPE_CHECKOUT_KEY: string;
STRIPE_WEBHOOK_SECRET: string;
STATIC_ASSETS: Fetcher
}
// global .env

View file

@ -1,6 +1,6 @@
#:schema node_modules/wrangler/config-schema.json
name = "supermemory-web"
compatibility_date = "2024-09-23"
compatibility_date = "2025-03-12"
pages_build_output_dir = "./build/client"
compatibility_flags = ["nodejs_compat"]