Skip to content

Commit 63ba49e

Browse files
authored
Merge pull request #315 from FalkorDB/staging
Staging
2 parents 0917b3f + 2a65193 commit 63ba49e

40 files changed

+2926
-1779
lines changed

app/GTM.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"use client"
2+
3+
import { useEffect } from "react";
4+
import TagManager from "react-gtm-module";
5+
6+
export default function GTM() {
7+
useEffect(() => {
8+
const gtmId = process.env.NEXT_PUBLIC_GTM_ID
9+
if (gtmId) {
10+
TagManager.initialize({ gtmId });
11+
}
12+
}, []);
13+
14+
return null;
15+
}

app/api/utils.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
export function getEnvVariables() {
2-
const url = process.env.BACKEND_URL
3-
const token = process.env.SECRET_TOKEN
2+
const { SECRET_TOKEN, BACKEND_URL } = process.env
43

5-
if (!url) {
4+
if (!BACKEND_URL) {
65
throw new Error("Environment variable BACKEND_URL must be set");
76
}
8-
if (!token) {
7+
if (!SECRET_TOKEN) {
98
throw new Error("Environment variable SECRET_TOKEN must be set");
109
}
1110

12-
return { url, token }
11+
return { url: BACKEND_URL, token: SECRET_TOKEN };
1312
}

app/components/Input.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export default function Input({ value, onValueChange, handleSubmit, graph, icon,
3333
}, [open])
3434

3535
useEffect(() => {
36+
if (!graph.Id) return
37+
3638
let isLastRequest = true
3739
const timeout = setTimeout(async () => {
3840

@@ -75,7 +77,7 @@ export default function Input({ value, onValueChange, handleSubmit, graph, icon,
7577
clearTimeout(timeout)
7678
isLastRequest = false
7779
}
78-
}, [value])
80+
}, [value, graph.Id])
7981

8082
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
8183
const container = containerRef.current

app/components/chat.tsx

Lines changed: 111 additions & 123 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)