From c089824b05b8501f0673192619be6232bb139eda Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Thu, 3 Oct 2024 22:18:03 -0400 Subject: [PATCH] Fix some updating bugs --- client/src/pages/Teacher/Dashboard/Dashboard.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/pages/Teacher/Dashboard/Dashboard.tsx b/client/src/pages/Teacher/Dashboard/Dashboard.tsx index ae24063..7226fe4 100644 --- a/client/src/pages/Teacher/Dashboard/Dashboard.tsx +++ b/client/src/pages/Teacher/Dashboard/Dashboard.tsx @@ -293,7 +293,7 @@ const Dashboard: React.FC = () => { } setQuizzes(quizzes as QuizType[]); - + setSelectedFolder(''); } catch (error) { console.error('Error deleting folder:', error); @@ -318,9 +318,11 @@ const Dashboard: React.FC = () => { try { // folderId: string GET THIS FROM CURRENT FOLDER await ApiService.duplicateFolder(selectedFolder); + // TODO set the selected folder to be the duplicated folder const userFolders = await ApiService.getUserFolders(); setFolders(userFolders as FolderType[]); - + const newlyCreatedFolder = userFolders[userFolders.length - 1] as FolderType; + setSelectedFolder(newlyCreatedFolder._id); } catch (error) { console.error('Error duplicating folder:', error); } @@ -402,7 +404,6 @@ const Dashboard: React.FC = () => {
- { > - +