daRk-ang3L07 commited on
Commit
e4e2dde
·
1 Parent(s): f8c4660

Fix TypeScript build errors

Browse files
Files changed (2) hide show
  1. frontend/src/App.tsx +5 -5
  2. frontend/tsconfig.json +4 -0
frontend/src/App.tsx CHANGED
@@ -4,8 +4,8 @@ import Markdown from 'markdown-to-jsx'
4
  import { supabase } from './lib/supabase'
5
  import LoginModal from './components/LoginModal'
6
  import ConfirmModal from './components/ConfirmModal'
7
- import { loadChatHistory, saveMessage } from './lib/chatHistory'
8
- import { Session } from '@supabase/supabase-js'
9
 
10
  interface Message {
11
  role: 'user' | 'assistant'
@@ -77,11 +77,11 @@ function App() {
77
  const fileInputRef = useRef<HTMLInputElement>(null)
78
 
79
  useEffect(() => {
80
- supabase.auth.getSession().then(({ data: { session } }) => {
81
  setSession(session)
82
  setIsInitializingAuth(false)
83
  })
84
- const { data: { subscription } } = supabase.auth.onAuthStateChange((_event, session) => {
85
  setSession(session)
86
  setIsInitializingAuth(false)
87
  })
@@ -102,7 +102,7 @@ function App() {
102
  useEffect(() => {
103
  if (session) {
104
  fetchFiles()
105
- loadChatHistory().then(history => {
106
  if (history.length > 0) {
107
  setMessages(history as Message[])
108
  }
 
4
  import { supabase } from './lib/supabase'
5
  import LoginModal from './components/LoginModal'
6
  import ConfirmModal from './components/ConfirmModal'
7
+ import { loadChatHistory, saveMessage, StoredMessage } from './lib/chatHistory'
8
+ import { Session, AuthChangeEvent } from '@supabase/supabase-js'
9
 
10
  interface Message {
11
  role: 'user' | 'assistant'
 
77
  const fileInputRef = useRef<HTMLInputElement>(null)
78
 
79
  useEffect(() => {
80
+ supabase.auth.getSession().then(({ data: { session } }: { data: { session: Session | null } }) => {
81
  setSession(session)
82
  setIsInitializingAuth(false)
83
  })
84
+ const { data: { subscription } } = supabase.auth.onAuthStateChange((_event: AuthChangeEvent, session: Session | null) => {
85
  setSession(session)
86
  setIsInitializingAuth(false)
87
  })
 
102
  useEffect(() => {
103
  if (session) {
104
  fetchFiles()
105
+ loadChatHistory().then((history: StoredMessage[]) => {
106
  if (history.length > 0) {
107
  setMessages(history as Message[])
108
  }
frontend/tsconfig.json CHANGED
@@ -13,6 +13,10 @@
13
  "isolatedModules": true,
14
  "noEmit": true,
15
  "jsx": "react-jsx",
 
 
 
 
16
 
17
  /* Linting */
18
  "strict": true,
 
13
  "isolatedModules": true,
14
  "noEmit": true,
15
  "jsx": "react-jsx",
16
+ "baseUrl": ".",
17
+ "paths": {
18
+ "@/*": ["src/*"]
19
+ },
20
 
21
  /* Linting */
22
  "strict": true,