Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions app/(marketing)/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import fs from "fs";
import path from "path";
import matter from "gray-matter";
import { notFound } from "next/navigation";
import * as Sentry from "@sentry/nextjs";
import MarkdownContent from "@/components/markdown-content";

export const dynamicParams = false;
Expand All @@ -18,7 +17,6 @@ export async function generateStaticParams() {
slug: file.replace(/\.mdx$/, ""),
}));
} catch (error) {
console.error("Error reading content directory:", error);
return [];
}
}
Expand Down Expand Up @@ -57,6 +55,7 @@ export default async function MarketingPage({
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
console.log("Generating page for slug:", slug);
const filePath = path.join(
process.cwd(),
"content/marketing/",
Expand Down Expand Up @@ -93,12 +92,7 @@ export default async function MarketingPage({
</main>
</div>
);
} catch (error) {
Sentry.captureException(error);
console.error(
"Error reading file, this should have never happened:",
error,
);
} catch {
notFound();
}
}
25 changes: 25 additions & 0 deletions app/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { MetadataRoute } from "next";

export default function manifest(): MetadataRoute.Manifest {
return {
name: "Pegna AI",
short_name: "pegna ai",
description: "The best chatbot in the world.",
start_url: "/chat",
display: "standalone",
background_color: "#ffffff",
theme_color: "#000000",
icons: [
{
src: "/logo-192.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/logo-512.png",
sizes: "512x512",
type: "image/png",
},
],
};
}
59 changes: 49 additions & 10 deletions app/settings/sync/delete-all-data-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@ import { Trash2 } from "lucide-react";
import { toast } from "sonner";
import { deleteAllServerData } from "./actions";
import { chatDB } from "@/lib/localDb";
import { useContext } from "react";
import { useContext, useState } from "react";
import { SyncDataContext } from "@/components/sync-data-provider";
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from "@/components/ui/alert-dialog";

export default function DeleteAllDataButton() {
const [showDeleteAllDialog, setShowDeleteAllDialog] = useState(false);
const syncEngine = useContext(SyncDataContext);

const deleteDataMutation = useMutation({
Expand All @@ -30,15 +41,43 @@ export default function DeleteAllDataButton() {
},
});

function onConfirm() {
setShowDeleteAllDialog(false);
deleteDataMutation.mutate();
}

return (
<Button
variant="destructive"
className="w-full md:w-auto mt-4 md:mt-0"
onClick={() => deleteDataMutation.mutate()}
disabled={deleteDataMutation.isPending || syncEngine?.isSyncing}
>
<Trash2 />
Delete All User Data
</Button>
<>
<Button
variant="destructive"
className="w-full md:w-auto mt-4 md:mt-0"
onClick={() => setShowDeleteAllDialog(true)}
disabled={deleteDataMutation.isPending || syncEngine?.isSyncing}
>
<Trash2 />
Delete All User Data
</Button>
<AlertDialog open={showDeleteAllDialog}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>
Do you really want to delete all your user data?
</AlertDialogTitle>
<AlertDialogDescription>
This will permanently delete all your user data from the server
and your browser, including all chats, images, and documents. It
won&apos;t delete your account or settings. This action cannot be
undone.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel onClick={() => setShowDeleteAllDialog(false)}>
Cancel
</AlertDialogCancel>
<AlertDialogAction onClick={onConfirm}>Confirm</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</>
);
}
Binary file added public/logo-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.