wepee commited on
Commit
e7233fa
·
1 Parent(s): a071963

add: loader history

Browse files
Files changed (1) hide show
  1. resources/js/pages/mahasiswa.tsx +4 -2
resources/js/pages/mahasiswa.tsx CHANGED
@@ -23,6 +23,7 @@ import { show as showMahasiswaChat } from '@/routes/mahasiswa';
23
  export default function Mahasiswa() {
24
  const [courses, setCourses] = useState<CourseResponse[]>([]);
25
  const [chatSessions, setChatSessions] = useState<ChatSessionResponse[]>([]);
 
26
  const [isLoadingCourses, setIsLoadingCourses] = useState(true);
27
  const [backendMessage, setBackendMessage] = useState<string>();
28
  const [isProcessing, setIsProcessing] = useState(false);
@@ -44,7 +45,8 @@ export default function Mahasiswa() {
44
 
45
  listChatSessions()
46
  .then((r) => setChatSessions(r.data))
47
- .catch(() => {});
 
48
  }, []);
49
 
50
  const handleDeleteSession = (
@@ -106,7 +108,7 @@ export default function Mahasiswa() {
106
 
107
  <StudentShell
108
  chatSessions={chatSessions}
109
- isLoadingSessions={false}
110
  onDeleteSession={handleDeleteSession}
111
  studentName={studentName}
112
  >
 
23
  export default function Mahasiswa() {
24
  const [courses, setCourses] = useState<CourseResponse[]>([]);
25
  const [chatSessions, setChatSessions] = useState<ChatSessionResponse[]>([]);
26
+ const [isLoadingSessions, setIsLoadingSessions] = useState(true);
27
  const [isLoadingCourses, setIsLoadingCourses] = useState(true);
28
  const [backendMessage, setBackendMessage] = useState<string>();
29
  const [isProcessing, setIsProcessing] = useState(false);
 
45
 
46
  listChatSessions()
47
  .then((r) => setChatSessions(r.data))
48
+ .catch(() => {})
49
+ .finally(() => setIsLoadingSessions(false));
50
  }, []);
51
 
52
  const handleDeleteSession = (
 
108
 
109
  <StudentShell
110
  chatSessions={chatSessions}
111
+ isLoadingSessions={isLoadingSessions}
112
  onDeleteSession={handleDeleteSession}
113
  studentName={studentName}
114
  >