Skip to content

Commit

Permalink
made few changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nisabmohd committed Jan 27, 2024
1 parent e5627c2 commit 4ff7644
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
10 changes: 0 additions & 10 deletions actions/auth.ts

This file was deleted.

2 changes: 0 additions & 2 deletions actions/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ declare global {
const map = globalThis.ai_map ?? new Map<string, OpenAI>();

async function createCompletion(apiKey: string, message: string) {
console.time();
let ai: OpenAI;
if (map.has(apiKey)) {
ai = map.get(apiKey)!;
Expand All @@ -106,7 +105,6 @@ async function createCompletion(apiKey: string, message: string) {
});
map.set(apiKey, ai);
}
console.timeEnd();
const chatCompletion = await ai.chat.completions.create({
messages: [{ role: "user", content: message }],
model: "gpt-3.5-turbo",
Expand Down
3 changes: 2 additions & 1 deletion app/(public-layout)/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import GoogleLogin from "@/components/google-login";

export default function Login() {
return (
<div>
<div className="flex flex-col items-center gap-5 justify-center h-[70vh]">
<h3 className="text-2xl font-bold text-center">Login to OpenChat</h3>
<GoogleLogin />
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions app/(public-layout)/(auth)/register/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import GoogleLogin from "@/components/google-login";

export default function Register() {
export default function Login() {
return (
<div>
<div className="flex flex-col items-center gap-5 justify-center h-[70vh]">
<h3 className="text-2xl font-bold text-center">Register to OpenChat</h3>
<GoogleLogin />
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion components/hero-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import Link from "next/link";
import { NamedLogoWithLink } from "./logo";
import { buttonVariants } from "./ui/button";
import ToggleTheme from "./toggle";

export default function HeroNav() {
return (
<nav className="w-full flex flex-row items-center justify-between h-24 mb-7 top-0 sticky bg-background">
<NamedLogoWithLink />
<div className="flex flex-row items-center">
<ToggleTheme />
<Link
href="/login"
className={buttonVariants({
variant: "link",
className: "text-base",
className: "text-base sm:ml-3",
size: "sm",
})}
>
Expand Down
9 changes: 8 additions & 1 deletion components/signout-btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import { signOut } from "next-auth/react";

export default function SignOutButton() {
return (
<Button className="w-24" variant="destructive" onClick={() => signOut()}>
<Button
className="w-24"
variant="destructive"
onClick={() => {
signOut();
localStorage.removeItem("apiKey");
}}
>
Signout
</Button>
);
Expand Down

0 comments on commit 4ff7644

Please sign in to comment.