select first room by default on dashboard

This commit is contained in:
C. Fuhrman 2025-02-26 09:31:20 -05:00
parent 5436fc3a1f
commit 0bf2bf7747

View file

@ -91,6 +91,10 @@ const Dashboard: React.FC = () => {
} else {
const userRooms = await ApiService.getUserRooms();
setRooms(userRooms as RoomType[]);
// select the first room if it exists
if (userRooms instanceof Array && userRooms.length > 0) {
selectRoom(userRooms[0]._id);
}
const userFolders = await ApiService.getUserFolders();
setFolders(userFolders as FolderType[]);